Java-Techie-jt / splunk-logging

Analyze Realtime logs using splunk
0 stars 25 forks source link

Couldn't push logs to splunk. #1

Open sudha50 opened 1 year ago

sudha50 commented 1 year ago

I can see logs being written to console 2022-12-30 17:19:37,124 main ERROR Unable to locate appender "splunkhttp" for logger config "root"

. _ _ /\ / '_ () \ \ \ \ ( ( )\ | ' | '| | ' \/ ` | \ \ \ \ \/ _)| |)| | | | | || (| | ) ) ) ) ' |__| .|| ||| |\, | / / / / =========|_|==============|__/=//// :: Spring Boot :: (v3.0.1)

2022-12-30T17:19:37,221 INFO [main] org.springframework.boot.StartupInfoLogger: Starting SplunkLogsApplication using Java 19.0.1 with PID 15091 (/Users/apple/Downloads/splunk-logs/target/classes started by apple in /Users/apple/Downloads/splunk-logs) 2022-12-30T17:19:37,229 INFO [main] org.springframework.boot.SpringApplication: No active profile set, falling back to 1 default profile: "default" 2022-12-30T17:19:38,088 INFO [main] org.springframework.boot.web.embedded.tomcat.TomcatWebServer: Tomcat initialized with port(s): 8080 (http) 2022-12-30T17:19:38,097 INFO [main] org.apache.juli.logging.DirectJDKLog: Initializing ProtocolHandler ["http-nio-8080"] 2022-12-30T17:19:38,098 INFO [main] org.apache.juli.logging.DirectJDKLog: Starting service [Tomcat] 2022-12-30T17:19:38,098 INFO [main] org.apache.juli.logging.DirectJDKLog: Starting Servlet engine: [Apache Tomcat/10.1.4] 2022-12-30T17:19:38,149 INFO [main] org.apache.juli.logging.DirectJDKLog: Initializing Spring embedded WebApplicationContext 2022-12-30T17:19:38,150 INFO [main] org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext: Root WebApplicationContext: initialization completed in 865 ms 2022-12-30T17:19:38,487 INFO [main] org.apache.juli.logging.DirectJDKLog: Starting ProtocolHandler ["http-nio-8080"] 2022-12-30T17:19:38,527 INFO [main] org.springframework.boot.web.embedded.tomcat.TomcatWebServer: Tomcat started on port(s): 8080 (http) with context path '' 2022-12-30T17:19:38,536 INFO [main] org.springframework.boot.StartupInfoLogger: Started SplunkLogsApplication in 1.895 seconds (process running for 7.687) 2022-12-30T17:20:41,157 INFO [http-nio-8080-exec-1] org.apache.juli.logging.DirectJDKLog: Initializing Spring DispatcherServlet 'dispatcherServlet' 2022-12-30T17:20:41,157 INFO [http-nio-8080-exec-1] org.springframework.web.servlet.FrameworkServlet: Initializing Servlet 'dispatcherServlet' 2022-12-30T17:20:41,158 INFO [http-nio-8080-exec-1] org.springframework.web.servlet.FrameworkServlet: Completed initialization in 1 ms 2022-12-30T17:20:41,272 INFO [http-nio-8080-exec-1] com.kti.splunklogs.SplunkLogsApplication: OrderController:placeOrder persist order request {"id":3,"name":"Samsung","qty":1,"price":10000.0,"transactionId":null,"orderPlacedDate":null} 2022-12-30T17:20:41,273 INFO [http-nio-8080-exec-1] com.kti.splunklogs.service.OrderService: OrderService:addOrder() execution started.. 2022-12-30T17:20:41,274 INFO [http-nio-8080-exec-1] com.kti.splunklogs.service.OrderService: OrderService:addOrder() request payload: {"id":3,"name":"Samsung","qty":1,"price":10000.0,"transactionId":null,"orderPlacedDate":null} 2022-12-30T17:20:41,278 INFO [http-nio-8080-exec-1] com.kti.splunklogs.service.OrderService: OrderService:addOrder response {"id":3,"name":"Samsung","qty":1,"price":10000.0,"transactionId":"456bd933-bb75-4830-872a-c4643864c2b2","orderPlacedDate":1672401041274} 2022-12-30T17:20:41,278 INFO [http-nio-8080-exec-1] com.kti.splunklogs.service.OrderService: OrderService:addOrder execution ended.. 2022-12-30T17:20:41,281 INFO [http-nio-8080-exec-1] com.kti.splunklogs.SplunkLogsApplication: OrderController:placeOrder response from service {"id":3,"name":"Samsung","qty":1,"price":10000.0,"transactionId":"456bd933-bb75-4830-872a-c4643864c2b2","orderPlacedDate":1672401041274}

but not to splunk my log4j2-spring.xml `<?xml version="1.0" encoding="UTF-8"?>

`
VinayakJamadar commented 7 months ago

I am also getting same issue. @basahota Please help

VinayakJamadar commented 7 months ago

@sudha50 have u resolved the issue?