Enable OTP debug logging

252 views
Skip to first unread message

Nicolas Derive

unread,
Apr 12, 2017, 7:35:59 AM4/12/17
to opentripplanner-dev
Dear all,

I'm trying to enable debug or info logging verbosity level in OTP to have a look at what is happening using a given GTFS-RT feed. I tried to pass -Dlogging.level=INFO to Java without success.

How can I correctly activate this verbosity level? I looked at the docs but found nothing related to this. That may be a newbie question but I'm not a Java expert, sorry...


Thanks for your help.


Nicolas

Marko Burjek

unread,
Apr 12, 2017, 11:31:08 AM4/12/17
to Nicolas Derive, opentripplanner-dev
Hello,

OTP uses Logback for logger configuration.

You need to add path to your logback.xml:
-Dlogback.configurationFile=pathToFile.xml (I used absolute)


existing logback.xml is in src/main/resources/logback.xml and you can change root logger or specific loggers and copy it somewhere else.

It also works if you change existing logback.xml, but you need to rebuild code so that new JAR is created for that. If you use your xml you only need to restart after each change.


Here is some information about logback logging: https://logback.qos.ch/manual/configuration.html


--
You received this message because you are subscribed to the Google Groups "OpenTripPlanner Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner-dev+unsub...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrew Byrd

unread,
Apr 13, 2017, 1:26:35 AM4/13/17
to Marko Burjek, Nicolas Derive, opentripplanner-dev

> On 12 Apr 2017, at 23:31, Marko Burjek <email...@gmail.com> wrote:
> You need to add path to your logback.xml:
> -Dlogback.configurationFile=pathToFile.xml (I used absolute)

Thanks for the hint Marko. Just to clarify a bit more, I believe you need to add this switch to your Java command line when starting OTP; the switch specifies the path to the logback configuration XML file. What you add to that logback XML is the logging level configurations themselves.

Andrew

Nicolas Derive

unread,
Apr 13, 2017, 1:56:17 PM4/13/17
to Andrew Byrd, email...@gmail.com, opentripplanner-dev
Hello Marko and Andrew,


Thanks for your answers​.

I had more info for debugging my problem, but trip_id are not outputted when a tripupdate failed, and that would be helpful to have it. I reported that problem under https://github.com/opentripplanner/OpenTripPlanner/issues/2430 (with your latest issue Andrew, that makes 666 open issues​, that's evily high ;) )

Have a nice evening,


Nicolas
Reply all
Reply to author
Forward
0 new messages