add grafana loki config
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package zw.qantra.tm.domain.controllers;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.core.Authentication;
|
||||
@@ -19,6 +21,19 @@ public class TestController {
|
||||
private final EmailService emailService;
|
||||
private final TransactionService transactionService;
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(TestController.class);
|
||||
|
||||
@GetMapping("/test-logs")
|
||||
public String testLogs() {
|
||||
logger.trace("This is a TRACE log");
|
||||
logger.debug("This is a DEBUG log");
|
||||
logger.info("This is an INFO log");
|
||||
logger.warn("This is a WARN log");
|
||||
logger.error("This is an ERROR log");
|
||||
|
||||
return "Logs sent to OpenTelemetry!";
|
||||
}
|
||||
|
||||
@PostMapping("/dbtest")
|
||||
public ResponseEntity<Object> dbtest(@RequestBody Transaction transaction) {
|
||||
transactionService.save(transaction);
|
||||
|
||||
Reference in New Issue
Block a user