I used "logagent" docker to ship my Java Project logs to sematext cloud, but it seems Java Exceptions(especially in multilines) could not be parsed well. I have tried to add some patterns myself but Exception logs still get multiple records in sematext cloud.
Below is my sample Exception trace:
2020-05-20 16:23:23.088 [scheduling-1] ERROR n.a.processor.agent.AQIUpdateAgent.doUpdating - Failed to update AQI
net.aqimp.exception.InternalException: Failed to send request
at net.aqimp.processor.agent.AQIFetchAgent.fetchAQI(AQIFetchAgent.java:81)
at net.aqimp.processor.agent.AQIUpdateAgent.doUpdating(AQIUpdateAgent.java:51)
at net.aqimp.controller.ServiceScheduler.regularlyUpdateAQI(ServiceScheduler.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:84)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: net.aqimp.exception.CommunicationException: Failed to send request to URL
at net.aqimp.processor.communication.AQIHttpRequestHandler.proceedRequest(AQIHttpRequestHandler.java:87)
at net.aqimp.processor.agent.AQIFetchAgent.fetchAQI(AQIFetchAgent.java:72)
... 15 common frames omitted
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
at sun.security.ssl.InputRecord.readV3Record(InputRecord.java:593)
at sun.security.ssl.InputRecord.read(InputRecord.java:532)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:990)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1388)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1416)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1400)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1570)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:352)
at net.aqimp.processor.communication.AQIHttpRequestHandler.proceedRequest(AQIHttpRequestHandler.java:69)
... 16 common frames omitted
And one normal log sample:
2020-05-20 16:23:23.088 [scheduling-1] INFO n.a.p.c.AQIHttpRequestHandler.proceedRequest - AQI server is querying
Hi,
I used "logagent" docker to ship my Java Project logs to sematext cloud, but it seems Java Exceptions(especially in multilines) could not be parsed well. I have tried to add some patterns myself but Exception logs still get multiple records in sematext cloud.
Below is my sample Exception trace:
And one normal log sample:
And my adding patterns in patterns.yml:
The trace look in sematext logs panel, and I wish to see one record in sematext logs but with the whole exception stack: