
Hi, I want to use logback with the maven-jetty plugin but I don't seem to be able to find the right place to put the logback.xml file. I've read the jetty app by itself looks in the $JETTY_HOME/resources folder but $project/src/resources doesn't seem to work for the plugin. Any ideas? Thanks, Kevin

m2's default resource location is src/main/resources, if you put it there i'm pretty sure jetty will pick it up from the classpath. If you use src/resources you have to configure explicitly in build/resources IIRC. On 6/20/07, Kevin S. Clarke <ksclarke@gmail.com> wrote:
Hi,
I want to use logback with the maven-jetty plugin but I don't seem to be able to find the right place to put the logback.xml file. I've read the jetty app by itself looks in the $JETTY_HOME/resources folder but $project/src/resources doesn't seem to work for the plugin.
Any ideas?
Thanks, Kevin _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user

Hi Kevin, Do you wish to use logback-classic or logback-access with the maven-jetty plug-in? For logback-classic, place logback.xml in src/main/resources or src/test/resources. Did you know that logback-classic checks for logback-test.xml first and for logback.xml second? HTH, Kevin S. Clarke wrote:
Hi,
I want to use logback with the maven-jetty plugin but I don't seem to be able to find the right place to put the logback.xml file. I've read the jetty app by itself looks in the $JETTY_HOME/resources folder but $project/src/resources doesn't seem to work for the plugin.
Any ideas?
Thanks, Kevin
-- Ceki Gülcü Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch

Hi, Thanks for the reply. I've since realized that it is finding it in maven's src/main/resources but that the jetty logger doesn't seem to be changed by it. My logback config looks like: <configuration debug="true"> <appender name="Console" class="ch.qos.logback.core.ConsoleAppender"> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern> </layout> </appender> <appender name="File" class="ch.qos.logback.core.FileAppender"> <param name="file" value="diglib.log"/> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern> </layout> </appender> <logger name="org.mortbay"> <level value="warn"/> </logger> <root> <level value="warn"/> <appender-ref ref="File"/> <appender-ref ref="Console"/> </root> </configuration> If I get a logger for one of my classes and output something to it, the logback.xml is respected (nothing below "warn" comes out) in the log. For some reason though the jetty logger is outputting everything at the debug level despite having its logger set to warn in the config. 15:12:13.650 [main] INFO org.mortbay.log - Logging to Logger[org.mortbay.log] via org.mortbay.log.Slf4jLog 15:12:13.652 [main] DEBUG org.mortbay.log - Container Server@87e704 + SelectChannelConnector@0.0.0.0:9000 as connector 15:12:13.677 [main] DEBUG org.mortbay.log - Container Server@87e704 + HandlerCollection@15c97e4 as handler If I take the logback jars out of the maven-jetty's classpath then jetty uses the sterr and isn't in debug mode. I'm not sure why jetty in maven with logback seems to be stuck in debug for its output. Any ideas? Thanks, Kevin On 6/20/07, Ceki Gulcu <listid@qos.ch> wrote:
Hi Kevin,
Do you wish to use logback-classic or logback-access with the maven-jetty plug-in?
For logback-classic, place logback.xml in src/main/resources or src/test/resources.
Did you know that logback-classic checks for logback-test.xml first and for logback.xml second?
HTH,
Kevin S. Clarke wrote:
Hi,
I want to use logback with the maven-jetty plugin but I don't seem to be able to find the right place to put the logback.xml file. I've read the jetty app by itself looks in the $JETTY_HOME/resources folder but $project/src/resources doesn't seem to work for the plugin.
Any ideas?
Thanks, Kevin
-- Ceki Gülcü Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
participants (3)
-
Ceki Gulcu
-
Jorg Heymans
-
Kevin S. Clarke