Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GraphHopper .jar only log Errors, Bad Requests, etc

I'm using GrpahHopper's self hosted routing server v0.5, running on Ubuntu 15.10.

The solution is run via a terminal with a jar file and arbitrary OSM data.

Is there a way to control the logged output of the server (e.g. to only show exceptions, bad requests, etc.)?

like image 337
bilo-io Avatar asked Dec 15 '25 19:12

bilo-io


1 Answers

For that you'll have to repackage GraphHopper as there is no 'outside' configuration option provided - raise an issue if you need this.

Change the log4j.xml file under web/src/main/resources e.g. replace the root and com.graphhopper logger via the following snippet:

<logger name="com.graphhopper" additivity="false">
    <level value="warn" />
    <appender-ref ref="ASYNC" />
</logger>
<root>
    <priority value="warn"></priority>
    <appender-ref ref="ASYNC"/>
</root>

Then repackage GH via the quickstart from source.

Update it might be possible without repackaging via

export JAVA_OPTS="-Dlog4j.debug -Dlog4j.configuration=some-log-config.xml"

using the mentioned and updated log4j.xml but I've not tested this yet. See the log4j docs

like image 98
Karussell Avatar answered Dec 17 '25 07:12

Karussell



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!