
Hi, I'm new to logback and I'm trying to setting up a test project, who will use it. When I used log4j I simply added a file log4.properties on my src root and define some paramaters. My question is how to do the same, and wich paramaters I've to set. Thanks for your support. Regards. Alexandre Jaquet

Finally I found the translator http://logback.qos.ch/translator/Translate.do But with the parameter I've define under the <File> property : <File>${catalina.home}/logs/performance_test.log</File> Doesn't create a log file withe my name performance_test.log under the tomcat log directory, what do I've missed ? Thanks for your support, Regards. Alexandre Jaquet Alexandre Jaquet wrote:
Hi,
I'm new to logback and I'm trying to setting up a test project, who will use it. When I used log4j I simply added a file log4.properties on my src root and define some paramaters. My question is how to do the same, and wich paramaters I've to set.
Thanks for your support.
Regards.
Alexandre Jaquet _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
-- View this message in context: http://www.nabble.com/-newbie--Setting-up-a-project-tf3330855.html#a9261956 Sent from the Logback User mailing list archive at Nabble.com.

Hello again Alexandre, I've tried to use a variable like you mentionned and it worked fine. Could you try with this configuration file, and let me know if it works for you? Thanks, Sébastien <configuration debug="true"> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern>Application-A: %-4relative [%thread] %-5level - %msg %n</Pattern> </layout> </appender> <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <File>${catalina.home}/logs/testFile.log</File> <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> <FileNamePattern>testFile.%i.log.zip</FileNamePattern> <MinIndex>1</MinIndex> <MaxIndex>3</MaxIndex> </rollingPolicy> <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> <MaxFileSize>5MB</MaxFileSize> </triggeringPolicy> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern> </layout> </appender> <root> <level value="debug" /> <appender-ref ref="STDOUT" /> <appender-ref ref="FILE" /> </root> </configuration> Alexandre Jaquet wrote:
Finally I found the translator
http://logback.qos.ch/translator/Translate.do
But with the parameter I've define under the <File> property :
<File>${catalina.home}/logs/performance_test.log</File>
Doesn't create a log file withe my name performance_test.log under the tomcat log directory, what do I've missed ?
Thanks for your support,
Regards.
Alexandre Jaquet
Alexandre Jaquet wrote:
Hi,
I'm new to logback and I'm trying to setting up a test project, who will use it. When I used log4j I simply added a file log4.properties on my src root and define some paramaters. My question is how to do the same, and wich paramaters I've to set.
Thanks for your support.
Regards.
Alexandre Jaquet _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
-- Sébastien Pennec sebastien@qos.ch Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch/

Hi Sebastien :), Yes it's works fine, thanks for the advice. Cheers. Alexandre Jaquet Sebastien Pennec wrote:
Hello again Alexandre,
I've tried to use a variable like you mentionned and it worked fine.
Could you try with this configuration file, and let me know if it works for you?
Thanks,
Sébastien
<configuration debug="true">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern>Application-A: %-4relative [%thread] %-5level - %msg %n</Pattern> </layout> </appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <File>${catalina.home}/logs/testFile.log</File> <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> <FileNamePattern>testFile.%i.log.zip</FileNamePattern> <MinIndex>1</MinIndex> <MaxIndex>3</MaxIndex> </rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> <MaxFileSize>5MB</MaxFileSize> </triggeringPolicy> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern> </layout> </appender>
<root> <level value="debug" /> <appender-ref ref="STDOUT" /> <appender-ref ref="FILE" /> </root> </configuration>
Alexandre Jaquet wrote:
Finally I found the translator
http://logback.qos.ch/translator/Translate.do
But with the parameter I've define under the <File> property :
<File>${catalina.home}/logs/performance_test.log</File>
Doesn't create a log file withe my name performance_test.log under the tomcat log directory, what do I've missed ?
Thanks for your support,
Regards.
Alexandre Jaquet
Alexandre Jaquet wrote:
Hi,
I'm new to logback and I'm trying to setting up a test project, who will use it. When I used log4j I simply added a file log4.properties on my src root and define some paramaters. My question is how to do the same, and wich paramaters I've to set.
Thanks for your support.
Regards.
Alexandre Jaquet _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user

By doing the solution explain here http://www.nabble.com/Why-am-I-only-seeing-one-log-generated--tf3024278.html the file is created but nothing was written into the file :/ still doing some search. Alexandre Jaquet wrote:
Hi,
I'm new to logback and I'm trying to setting up a test project, who will use it. When I used log4j I simply added a file log4.properties on my src root and define some paramaters. My question is how to do the same, and wich paramaters I've to set.
Thanks for your support.
Regards.
Alexandre Jaquet _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
-- View this message in context: http://www.nabble.com/-newbie--Setting-up-a-project-tf3330855.html#a9262276 Sent from the Logback User mailing list archive at Nabble.com.

Here we are, A working sample <configuration debug="true"> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern>%-4relative [%thread] %-5level %class - %msg%n</Pattern> </layout> </appender> <logger name="org.accma.concentrator.services.bitran.BiTranService"> <level value="debug" /> <appender-ref ref="bitranlog" /> </logger> <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <File>c:\test_perf.log</File> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <FileNamePattern>soccs_%d{yyyy-MM}.log.gz</FileNamePattern> </rollingPolicy> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern>%-4relative [%thread] %-5level %class - %msg%n</Pattern> </layout> </appender> <logger name="org.accma.concentrator.services.soccs.SOCCSService"> <level value="debug" /> <appender-ref ref="FILE" /> </logger> <root> <level value="debug" /> <appender-ref ref="STDOUT" /> <appender-ref ref="FILE" /> </root> </configuration> Alexandre Jaquet wrote:
By doing the solution explain here
http://www.nabble.com/Why-am-I-only-seeing-one-log-generated--tf3024278.html
the file is created but nothing was written into the file :/
still doing some search.
Alexandre Jaquet wrote:
Hi,
I'm new to logback and I'm trying to setting up a test project, who will use it. When I used log4j I simply added a file log4.properties on my src root and define some paramaters. My question is how to do the same, and wich paramaters I've to set.
Thanks for your support.
Regards.
Alexandre Jaquet _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
-- View this message in context: http://www.nabble.com/-newbie--Setting-up-a-project-tf3330855.html#a9262334 Sent from the Logback User mailing list archive at Nabble.com.

Hi Alexandre, This configuration file should not work very well. <logger name="org.accma.concentrator.services.bitran.BiTranService"> <level value="debug" /> <appender-ref ref="bitranlog" /> </logger> Here, you declare an appender-ref element that links to a non-existent appender. Also, since your named logger have pretty specific names, there is a good chance that you might not call them at all in your code. Please refer to my last email with the joined configuration file, it should set you up with a ConsoleAppender and a RollingFileAppender that logs in the tomcat log directory. Hope this helps... Sébastien Alexandre Jaquet wrote:
Here we are,
A working sample
<configuration debug="true">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern>%-4relative [%thread] %-5level %class - %msg%n</Pattern> </layout> </appender>
<logger name="org.accma.concentrator.services.bitran.BiTranService"> <level value="debug" /> <appender-ref ref="bitranlog" /> </logger>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <File>c:\test_perf.log</File> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <FileNamePattern>soccs_%d{yyyy-MM}.log.gz</FileNamePattern> </rollingPolicy>
<layout class="ch.qos.logback.classic.PatternLayout"> <Pattern>%-4relative [%thread] %-5level %class - %msg%n</Pattern> </layout> </appender>
<logger name="org.accma.concentrator.services.soccs.SOCCSService"> <level value="debug" /> <appender-ref ref="FILE" /> </logger>
<root> <level value="debug" /> <appender-ref ref="STDOUT" /> <appender-ref ref="FILE" /> </root>
</configuration>
Alexandre Jaquet wrote:
By doing the solution explain here
http://www.nabble.com/Why-am-I-only-seeing-one-log-generated--tf3024278.html
the file is created but nothing was written into the file :/
still doing some search.
Alexandre Jaquet wrote:
Hi,
I'm new to logback and I'm trying to setting up a test project, who will use it. When I used log4j I simply added a file log4.properties on my src root and define some paramaters. My question is how to do the same, and wich paramaters I've to set.
Thanks for your support.
Regards.
Alexandre Jaquet _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
-- Sébastien Pennec sebastien@qos.ch Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch/

Ok, I've made the correction,by putting your config file. Thanks :) Alexandre Jaquet Sebastien Pennec wrote:
Hi Alexandre,
This configuration file should not work very well.
<logger name="org.accma.concentrator.services.bitran.BiTranService"> <level value="debug" /> <appender-ref ref="bitranlog" /> </logger>
Here, you declare an appender-ref element that links to a non-existent appender.
Also, since your named logger have pretty specific names, there is a good chance that you might not call them at all in your code.
Please refer to my last email with the joined configuration file, it should set you up with a ConsoleAppender and a RollingFileAppender that logs in the tomcat log directory.
Hope this helps...
Sébastien
Alexandre Jaquet wrote:
Here we are,
A working sample
<configuration debug="true">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <layout class="ch.qos.logback.classic.PatternLayout"> <Pattern>%-4relative [%thread] %-5level %class - %msg%n</Pattern> </layout> </appender>
<logger name="org.accma.concentrator.services.bitran.BiTranService"> <level value="debug" /> <appender-ref ref="bitranlog" /> </logger>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <File>c:\test_perf.log</File> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <FileNamePattern>soccs_%d{yyyy-MM}.log.gz</FileNamePattern> </rollingPolicy>
<layout class="ch.qos.logback.classic.PatternLayout"> <Pattern>%-4relative [%thread] %-5level %class - %msg%n</Pattern> </layout> </appender>
<logger name="org.accma.concentrator.services.soccs.SOCCSService"> <level value="debug" /> <appender-ref ref="FILE" /> </logger>
<root> <level value="debug" /> <appender-ref ref="STDOUT" /> <appender-ref ref="FILE" /> </root>
</configuration>
Alexandre Jaquet wrote:
By doing the solution explain here
http://www.nabble.com/Why-am-I-only-seeing-one-log-generated--tf3024278.html
the file is created but nothing was written into the file :/
still doing some search.
Alexandre Jaquet wrote:
Hi,
I'm new to logback and I'm trying to setting up a test project, who will use it. When I used log4j I simply added a file log4.properties on my src root and define some paramaters. My question is how to do the same, and wich paramaters I've to set.
Thanks for your support.
Regards.
Alexandre Jaquet _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user

Hello Alexandre, By default, logback loads the following files: - If a file called logback.xml is found in the classpath, then it is used. - In case it is not found, a logback-test.xml file is searched, and used if available. - If none of these files are available, logback uses its BasicConfigurator class to create a simple default configuration that will only log to the console. You might want to place a logback.xml file in the source directory, or in a location that makes the file available in the classpath once compilation is done. Regards, Sébastien Alexandre Jaquet wrote:
Hi,
I'm new to logback and I'm trying to setting up a test project, who will use it. When I used log4j I simply added a file log4.properties on my src root and define some paramaters. My question is how to do the same, and wich paramaters I've to set.
Thanks for your support.
Regards.
Alexandre Jaquet _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://qos.ch/mailman/listinfo/logback-user
-- Sébastien Pennec sebastien@qos.ch Logback: The reliable, generic, fast and flexible logging framework for Java. http://logback.qos.ch/
participants (2)
-
Alexandre Jaquet
-
Sebastien Pennec