How configure log4j multilines logging capture

Comments

4 comments

  • Avatar
    Kevin Keech

    Hi Alexander,

    If the auto detection ("Infer Boundaries") option does not detect your multi line messages then you will need to select the "Boundary Regex" option and supply a regular expression, which matches the entire first line of the messages. The second part is important, the expression must match the entire contents of the first line.

    Given the regex you supplied you may just need to add a .* to the beginning and end in order to capture the rest of the text in the line.

    Ex.

    .*\r[\s]+.*

     

    If you can supply a couple examples of your log messages we can also supply you an expression which will work.

    0
    Comment actions Permalink
  • Avatar
    Alexander Nalbandyan

    Here is an example of log  It would be great if you can provide regexp.

    2013-09-19 20:00:05,851 ERROR (AbstractPetsFtpExporter.java:196) - Exception during AdoptAPet Export for org: 53 message: error occurred in message handler [org.springframework.integration.file.remote.handler.FileTransferringMessageHandler#3]

    org.springframework.integration.MessageHandlingException: error occurred in message handler [org.springframework.integration.file.remote.handler.FileTransferringMessageHandler#3]

    at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:79)

    at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:115)

    at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:102)

    at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:77)

    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157)

    at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:128)

    at com.eyesoft.redpoint.service.jobs.AbstractPetsFtpExporter.exportAdoptablePets(AbstractPetsFtpExporter.java:108)

    at sun.reflect.GeneratedMethodAccessor725.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:597)

    at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:64)

    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:53)

    at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)

    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

    at java.util.concurrent.FutureTask.run(FutureTask.java:138)

    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)

    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)

    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

    at java.lang.Thread.run(Thread.java:662)

    Caused by: java.lang.IllegalStateException: failed to create FTPClient

    at org.springframework.integration.ftp.session.AbstractFtpSessionFactory.getSession(AbstractFtpSessionFactory.java:139)

    at org.springframework.integration.file.remote.session.CachingSessionFactory.doGetSession(CachingSessionFactory.java:100)

    at org.springframework.integration.file.remote.session.CachingSessionFactory.getSession(CachingSessionFactory.java:79)

    at org.springframework.integration.file.remote.handler.FileTransferringMessageHandler.handleMessageInternal(FileTransferringMessageHandler.java:147)

    at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:73)

    ... 20 more

    Caused by: java.lang.IllegalStateException: Login failed. The respponse from the server is: 530 Login authentication failed

    at org.springframework.integration.ftp.session.AbstractFtpSessionFactory.createClient(AbstractFtpSessionFactory.java:162)

    at org.springframework.integration.ftp.session.AbstractFtpSessionFactory.getSession(AbstractFtpSessionFactory.java:136)

    ... 24 more

    0
    Comment actions Permalink
  • Avatar
    Alexander Nalbandyan

    I have also attached the log.

    0
    Comment actions Permalink
  • Avatar
    Kevin Keech

    Sumo Logic should actually detect this message automatically, you should not have to supply a boundary expression.  However if they are not being auto detected you can use the timestamp from the message as the boundary with the following expression.

    .*\d{4}-\d{2}-\d{2}\s+\d{2}:\d{2}:\d{2},\d{3}\s.*

     

     

     

    0
    Comment actions Permalink

Please sign in to leave a comment.