Skip to content

Instantly share code, notes, and snippets.

@chathurangat
Created January 2, 2018 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chathurangat/46d0db83e2d1acacf3b163b96fc9e3eb to your computer and use it in GitHub Desktop.
Save chathurangat/46d0db83e2d1acacf3b163b96fc9e3eb to your computer and use it in GitHub Desktop.
@RestController
public class ApplicationLogController
{
@Autowired
private AppConfiguration appConfiguration;
@Autowired
private EnvironmentService environmentService;
@Autowired
private ApplicationLogRepository repository;
@PostMapping("/logs")
public ApplicationLog createApplicationLog()
{
ApplicationLog applicationLog = new ApplicationLog();
applicationLog.setConfiguration(appConfiguration.getName());
applicationLog.setEnvironment(environmentService.getCurrentEnvironment());
return repository.save(applicationLog);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment