How to show log.debug messages / set log level?

Enonic version: 6.8.1
OS: Mac and Linux

Running server.sh with “dev” or “debug” as first argument doesn’t seem to work.

There is a config file “logback.xml”

If you want to change the level of log for the entire server and applications, modify the level at the line
<root level="info”>

If you want something more specific you could add a logger with the package you want like below:
<logger name="com.enonic.app.myapp"> <level value="DEBUG" /> <appender-ref ref="STDOUT"/> </logger>

3 Likes

I tried commenting out the STDOUT in root and add the logger you suggested.

STDOUT simply got quiet. What I wanted was only debug messages to STDOUT.

Any suggestions on that?

Turned root to level debug now, which gives me all sort of Enonic server debugging which I don’t want.
I only want debugging of my controller code… is that possible with a specific logger definition?

I was a little quick, got it working now. I forgot to replace com.enonic.app.myapp with my app name.

To avoid duplicated lines in the log, use the additivity=“false” attribute:

<logger name="com.enonic.app.myapp" additivity="false">
  <level value="DEBUG" />
  <appender-ref ref="STDOUT"/>
</logger>

ref: https://logback.qos.ch/manual/configuration.html

1 Like