Hi, using this it is now complaining about a triggeringpolicy.<br><br>INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]<br>INFO in ch.qos.logback.core.joran.action.AppenderAction - Appender named as [bitranlog]<br>ERROR in ch.qos.logback.core.joran.action.NestedComponentIA - Could not create component <rollingPolicy>.<br>WARN in ch.qos.logback.core.rolling.RollingFileAppender[bitranlog] - Please set a TriggeringPolicy for the RollingFileAppender named bitranlog<br>INFO in ch.qos.logback.core.joran.action.AppenderAction - Popping appender named [bitranlog] from the object stack<br><br><br><b><i>Sebastien Pennec <sebastien@qos.ch></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Hello Samuel,<br><br>Thanks for trying logback!<br><br>The RollingFileAppender needs a TriggeringPolicy object to
know when to roll the <br>active output file.<br>In brief, a TriggeringPolicy controls the conditions under which roll-over occurs. <br>Such conditions include time of day, file size, an external event, the log request or <br>a combination thereof.<br><br>A working configuration file for a RollingFileAppender would be:<br><br><configuration><br> <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"><br> <param name="File" value="/path/to/your/file.log"><br> <rollingPolicy class="ch.qos.logback.core.rolling.SizeBasedRollingPolicy"><br> <param name="MaxFileSize" value="5MB"><br> </rollingPolicy><br> <layout class="ch.qos.logback.classic.PatternLayout"><br> <param name="Pattern" value="%-4relative [%thread] %-5level %class - %msg%n"><br> </layout><br> </appender><br><br> <root><br> <level value="debug"><br> <appender-ref ref="FILE"><br> </appender-ref><br></level><br><br>With this configuration, the file
would be rolled each time it reaches 5MB.<br><br>When I look at the configuration file that you sent, something seems strange to me:<br>Why do you configure two Loggers with the same Appender and one of them with the <br>Additivity flag set to false? One would obtain the same result simply by attaching <br>the RollingFileAppender to the root logger.<br><br>Hope this helps you get on track with logback. Do not hesitate to write again if you <br>run into trouble.<br><br>Sébastien<br><br>-- <br>Sébastien Pennec<br>sebastien@qos.ch<br><br>Logback: The reliable, generic, fast and flexible logging framework for Java.<br><br>Samuel Doyle a écrit :<br>> Hello,<br>> <br>> I'm new to logback but read your documentation, I an not receiving any <br>> output to my logfile. Here is my configuration file, following this is <br>> the output from logback to the console. The only thing I notice is a <br>> warning about a TriggerPolicy. If this is the case do you have
example <br>> syntax?<br>> ---<br>> <br>> <br>> <br>> <configuration><br>> <br>> <appender name="bitranlog"><br>> class="ch.qos.logback.core.rolling.RollingFileAppender"><br>> <param name="append" value="true"><br>> <param name="MaxBackupIndex" value="1"><br>> <param name="file" value="/tmp/bitran.log"><br>> <param name="MaxFileSize" value="5MB"><br>> <layout class="ch.qos.logback.classic.PatternLayout"><br>> <param name="pattern" value="%d [%-15.15t] %-5p %-30.30c{1} - %m%n"><br>> </layout><br>> </appender><br>> <br>> <logger name="org.accma.concentrator.services.bitran.BiTranService"><br>> additivity="false"><br>> <level value="debug"><br>> <appender-ref ref="bitranlog"><br>> </appender-ref><br>> <br>> <root><br>> <level value="debug"><br>> <appender-ref ref="bitranlog"><br>> </appender-ref><br>> <br>>
</level><br>> <br>> ---<br>> Here is console output when using LoggerStatusPrinter:<br>> ---<br>> <br>> startElement [configuration]<br>> startElement [appender]<br>> startElement [param]<br>> startElement [param]<br>> LOGBACK: No context given for ch.qos.logback.core.util.PropertySetter@8c5ea2<br>> startElement [param]<br>> startElement [param]<br>> LOGBACK: No context given for <br>> ch.qos.logback.core.util.PropertySetter@198defc<br>> startElement [layout]<br>> startElement [param]<br>> startElement [logger]<br>> startElement [level]<br>> startElement [appender-ref]<br>> startElement [root]<br>> startElement [level]<br>> startElement [appender-ref]<br>> INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - <br>> Ignoring debug attribute.<br>> INFO in ch.qos.logback.core.joran.action.AppenderAction - About to <br>> instantiate appender of type [ch<br>>
.qos.logback.core.rolling.RollingFileAppender]<br>> INFO in ch.qos.logback.core.joran.action.AppenderAction - Appender named <br>> as [bitranlog]<br>> WARN in ch.qos.logback.core.rolling.RollingFileAppender[bitranlog] - <br>> Please set a TriggeringPolicy<br>> for the RollingFileAppender named bitranlog<br>> INFO in ch.qos.logback.core.joran.action.AppenderAction - Popping <br>> appender named [bitranlog] from t<br>> he object stack<br>> INFO in ch.qos.logback.classic.joran.action.LevelAction - <br>> org.accma.concentrator.services.bitran.Bi<br>> TranService level set to DEBUG<br>> INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching <br>> appender named [bitranlog to<br>> Logger[org.accma.concentrator.services.bitran.BiTranService]<br>> INFO in ch.qos.logback.classic.joran.action.LevelAction - root level set <br>> to DEBUG<br>> INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching
<br>> appender named [bitranlog to<br>> Logger[root]<br>> <br>> <br>> Thanks, S.D.<br>> <br>> <br>> ------------------------------------------------------------------------<br>> <br>> _______________________________________________<br>> Logback-user mailing list<br>> Logback-user@qos.ch<br>> http://qos.ch/mailman/listinfo/logback-user<br>_______________________________________________<br>Logback-user mailing list<br>Logback-user@qos.ch<br>http://qos.ch/mailman/listinfo/logback-user<br></root></level></logger></configuration></root></configuration></blockquote><br>