Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@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