Log file appender

29 views
Skip to first unread message

Gilberto Minozzi

unread,
Oct 23, 2019, 1:48:22 PM10/23/19
to dropwizard-user
Hi everybody,

I try to use the latest release rc-11 and I have a problem logging in file (in console it works) in package different from the main one.

Gilberto

PS: logback.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true">

<property name="HOME_LOG" value="logs\app.log" />

<appender name="CONSOLE"
class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>
%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n
</Pattern>
</layout>
</appender>

<appender name="FILE" class="ch.qos.logback.core.FileAppender">
<file>${HOME_LOG}</file>
<append>true</append>
<immediateFlush>true</immediateFlush>
<encoder>
<pattern>%d %p %c{1.} [%t] %m%n</pattern>
</encoder>
</appender>

<logger name="it.gibba.drop" level="debug">
<appender-ref ref="FILE" />
<appender-ref ref="CONSOLE" />
</logger>

<root level="error">
<appender-ref ref="CONSOLE" />
</root>

</configuration>

project structure.PNG

Jochen Schalanda

unread,
Oct 24, 2019, 5:25:21 AM10/24/19
to dropwiz...@googlegroups.com
Hi Gilberto,

does it work when you try configuring your loggers as described in the documentation?

Best regards,
Jochen

--
You received this message because you are subscribed to the Google Groups "dropwizard-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dropwizard-us...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dropwizard-user/bfbf923c-a2b0-4251-9554-d39572b44c55%40googlegroups.com.
<project structure.PNG>

Gilberto Minozzi

unread,
Oct 24, 2019, 5:51:16 AM10/24/19
to dropwiz...@googlegroups.com
Hi Jochen,

I follow the configuration indeed my application could log in console in all the packages. 
The problem is only with the file appender in the secondary packages.

Attached an image of the situation.

Thanks and best regards,

Gilberto




--
Gilberto Minozzi
Java Developer

 

 
Via A. Riberi, 4 - 10124 Torino - Italia 
tel. 011 9537700 | int. 740


TURIN · ROME · BARI· SOFIA · LISBON · PRISTINA
www.advicegroup.it

 LinkedInTwitterYouTube
THINK PROGRESS, CHOOSE ADVICE
 


Before printing this page think about your responsibility with the Natural Environment.
This message is confidential; its contents do not constitute a commitment by Advice Group
S.p.A., except where provided for in a written agreement. Any unauthorized disclosure,
use or dissemination, either whole or partial, is prohibited. If you are not the intended
recipient of the message, please notify the sender immediately at in...@advicegroup.it.​
log schema.PNG
Reply all
Reply to author
Forward
0 new messages