Problem with Logging in Linux

Hi, i have the absolut identical file for Windows which works as expected (logging), but not for linux: http://rifers.org/paste/show/1801 There is just no logging - i started everything as root. Even when i use the FileAppender with its file name property set to "somelog.log" or "/root/somelog.log" it just saves nothing and i have no idea why. I used updatedb && locate to find a file called like this but there was nothing. Also lsof with a grep find nothing opened. So it is really not logging. Regards, Oli

Have you tried enabling logback's internal status messages? <configuration debug="true" scan=...> ... </configuration> On 24.08.2012 12:52, Oliver Zemann wrote:
Hi, i have the absolut identical file for Windows which works as expected (logging), but not for linux:
http://rifers.org/paste/show/1801
There is just no logging - i started everything as root. Even when i use the FileAppender with its file name property set to "somelog.log" or "/root/somelog.log" it just saves nothing and i have no idea why.
I used updatedb && locate to find a file called like this but there was nothing. Also lsof with a grep find nothing opened. So it is really not logging.
Regards, Oli
-- Ceki http://tinyurl.com/proLogback

Yes i did but the problem is that this application is a install4j application which does not handle stdio/stderr/stdout - so this is dropped. I do not see anything from the stdout :/ 2012/8/24 ceki <ceki@qos.ch>:
Have you tried enabling logback's internal status messages?
<configuration debug="true" scan=...> ... </configuration>
On 24.08.2012 12:52, Oliver Zemann wrote:
Hi, i have the absolut identical file for Windows which works as expected (logging), but not for linux:
http://rifers.org/paste/show/1801
There is just no logging - i started everything as root. Even when i use the FileAppender with its file name property set to "somelog.log" or "/root/somelog.log" it just saves nothing and i have no idea why.
I used updatedb && locate to find a file called like this but there was nothing. Also lsof with a grep find nothing opened. So it is really not logging.
Regards, Oli
-- Ceki http://tinyurl.com/proLogback _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

I think you need to use an absolute path to the log file. I recall other folks having issues before. Try that and let us know. --adam http://gordonizer.com On Fri, Aug 24, 2012 at 5:15 AM, Oliver Zemann <oliver.zemann@gmail.com>wrote:
Yes i did but the problem is that this application is a install4j application which does not handle stdio/stderr/stdout - so this is dropped. I do not see anything from the stdout :/
2012/8/24 ceki <ceki@qos.ch>:
Have you tried enabling logback's internal status messages?
<configuration debug="true" scan=...> ... </configuration>
On 24.08.2012 12:52, Oliver Zemann wrote:
Hi, i have the absolut identical file for Windows which works as expected (logging), but not for linux:
http://rifers.org/paste/show/1801
There is just no logging - i started everything as root. Even when i use the FileAppender with its file name property set to "somelog.log" or "/root/somelog.log" it just saves nothing and i have no idea why.
I used updatedb && locate to find a file called like this but there was nothing. Also lsof with a grep find nothing opened. So it is really not logging.
Regards, Oli
-- Ceki http://tinyurl.com/proLogback _______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

I tried it with /root/logback.log and with only logback.log After an updatedb && locate logback.log nothing was found, so i guess thats not the problem. Am 24.08.2012 17:34, schrieb Adam Gordon:
I think you need to use an absolute path to the log file. I recall other folks having issues before. Try that and let us know.
--adam
On Fri, Aug 24, 2012 at 5:15 AM, Oliver Zemann <oliver.zemann@gmail.com <mailto:oliver.zemann@gmail.com>> wrote:
Yes i did but the problem is that this application is a install4j application which does not handle stdio/stderr/stdout - so this is dropped. I do not see anything from the stdout :/
2012/8/24 ceki <ceki@qos.ch <mailto:ceki@qos.ch>>: > > Have you tried enabling logback's internal status messages? > > <configuration debug="true" scan=...> > ... > </configuration> > > > On 24.08.2012 12 <tel:24.08.2012%2012>:52, Oliver Zemann wrote: >> >> Hi, i have the absolut identical file for Windows which works as >> expected (logging), but not for linux: >> >> http://rifers.org/paste/show/1801 >> >> There is just no logging - i started everything as root. Even when i >> use the FileAppender with its file name property set to "somelog.log" >> or "/root/somelog.log" it just saves nothing and i have no idea why. >> >> I used updatedb && locate to find a file called like this but there >> was nothing. Also lsof with a grep find nothing opened. So it is >> really not logging. >> >> Regards, >> Oli >> > > > -- > Ceki > http://tinyurl.com/proLogback > _______________________________________________ > Logback-user mailing list > Logback-user@qos.ch <mailto:Logback-user@qos.ch> > http://mailman.qos.ch/mailman/listinfo/logback-user _______________________________________________ Logback-user mailing list Logback-user@qos.ch <mailto:Logback-user@qos.ch> http://mailman.qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

On Fri, Aug 24, 2012 at 6:52 AM, Oliver Zemann <oliver.zemann@gmail.com>wrote:
Hi, i have the absolut identical file for Windows which works as expected (logging), but not for linux:
http://rifers.org/paste/show/1801
There is just no logging - i started everything as root. Even when i use the FileAppender with its file name property set to "somelog.log" or "/root/somelog.log" it just saves nothing and i have no idea why.
I used updatedb && locate to find a file called like this but there was nothing. Also lsof with a grep find nothing opened. So it is really not logging.
Regards, Oli
Your config for the RollingFileAppender is missing the <file> element. The manual contains a good example of all the necessary elements [1]. logback should print a warning in the debug output for this. It would be helpful if you provided additional details to reproduce the problem: * What version of logback and slf4j are you using? * Which flavor (and version) of Linux are you running? * Does the same problem occur when you try your logback config in a simple HelloWorld app (outside of install4j)? FYI, your logback config works (writes to a file) for me in Android. It looks like Install4j supports a console [2], when running the installer with "-c". It might be worth seeing if logback's debug-output prints in that console. [1]: http://logback.qos.ch/manual/appenders.html#logback-RollingTimeBased [2]: http://www.ej-technologies.com/products/install4j/whatsnew4.html

Have you enabled automatic printing of status messages in case of warming or errors? (see <http://logback.qos.ch/manual/configuration.html#automaticStatusPrinting> http://logback.qos.ch/manual/configuration.html#automaticStatusPrinting) It will go to your console. From: logback-user-bounces@qos.ch [mailto:logback-user-bounces@qos.ch] On Behalf Of Tony Trinh Sent: 25. august 2012 23:57 To: logback users list Subject: Re: [logback-user] Problem with Logging in Linux On Fri, Aug 24, 2012 at 6:52 AM, Oliver Zemann <oliver.zemann@gmail.com> wrote: Hi, i have the absolut identical file for Windows which works as expected (logging), but not for linux: http://rifers.org/paste/show/1801 There is just no logging - i started everything as root. Even when i use the FileAppender with its file name property set to "somelog.log" or "/root/somelog.log" it just saves nothing and i have no idea why. I used updatedb && locate to find a file called like this but there was nothing. Also lsof with a grep find nothing opened. So it is really not logging. Regards, Oli Your config for the RollingFileAppender is missing the <file> element. The manual contains a good example of all the necessary elements [1]. logback should print a warning in the debug output for this. It would be helpful if you provided additional details to reproduce the problem: * What version of logback and slf4j are you using? * Which flavor (and version) of Linux are you running? * Does the same problem occur when you try your logback config in a simple HelloWorld app (outside of install4j)? FYI, your logback config works (writes to a file) for me in Android. It looks like Install4j supports a console [2], when running the installer with "-c". It might be worth seeing if logback's debug-output prints in that console. [1]: http://logback.qos.ch/manual/appenders.html#logback-RollingTimeBased [2]: http://www.ej-technologies.com/products/install4j/whatsnew4.html

The problem is that the software is running productive on customer side, so there is no way to just deinstall the application and reinstall it... * What version of logback and slf4j are you using? logback 1.0.6 (classic and core), slf4j-api 1.6.5 * Which flavor (and version) of Linux are you running? CentOS 5.8 and 6.3 * Does the same problem occur when you try your logback config in a simple HelloWorld app (outside of install4j)? Just tried it with creating a standalone jar from maven (jar-with-dependencies) and its working as expected but its embedded now. will check this in a few moments. Regards, Oli 2012/8/27 Thorbjørn Ravn Andersen <thunderaxiom@hotmail.com>:
Have you enabled automatic printing of status messages in case of warming or errors?
(see http://logback.qos.ch/manual/configuration.html#automaticStatusPrinting)
It will go to your console.
From: logback-user-bounces@qos.ch [mailto:logback-user-bounces@qos.ch] On Behalf Of Tony Trinh Sent: 25. august 2012 23:57 To: logback users list Subject: Re: [logback-user] Problem with Logging in Linux
On Fri, Aug 24, 2012 at 6:52 AM, Oliver Zemann <oliver.zemann@gmail.com> wrote:
Hi, i have the absolut identical file for Windows which works as expected (logging), but not for linux:
http://rifers.org/paste/show/1801
There is just no logging - i started everything as root. Even when i use the FileAppender with its file name property set to "somelog.log" or "/root/somelog.log" it just saves nothing and i have no idea why.
I used updatedb && locate to find a file called like this but there was nothing. Also lsof with a grep find nothing opened. So it is really not logging.
Regards, Oli
Your config for the RollingFileAppender is missing the <file> element. The manual contains a good example of all the necessary elements [1]. logback should print a warning in the debug output for this.
It would be helpful if you provided additional details to reproduce the problem:
* What version of logback and slf4j are you using?
* Which flavor (and version) of Linux are you running?
* Does the same problem occur when you try your logback config in a simple HelloWorld app (outside of install4j)?
FYI, your logback config works (writes to a file) for me in Android.
It looks like Install4j supports a console [2], when running the installer with "-c". It might be worth seeing if logback's debug-output prints in that console.
[1]: http://logback.qos.ch/manual/appenders.html#logback-RollingTimeBased
[2]: http://www.ej-technologies.com/products/install4j/whatsnew4.html
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

I was able to easily get it working with maven when i copied the file into my resources folder, but it is not working with ant. Somehow it is not found, in that case all debugging options in the xml makes no sense as this is just not found. I tested it with StatusPrinter and printing the LoggerContext: run: 12:58:06.590 [main] ERROR com.logbackanttest.LogbackAntTest - ERROR 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy] 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml] 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.xml] 12:58:06,546 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Setting up default configuration. I am currently in the project root directory, where a logback.xml is located. Also the dist folder (created by netbeans) contains a logback.xml and inside this dist folder the folder lib is created (containing the 3 jars, logback common, classic and slf4j) where also a logback.xml is located. 2012/8/27 Oliver Zemann <oliver.zemann@gmail.com>:
The problem is that the software is running productive on customer side, so there is no way to just deinstall the application and reinstall it...
* What version of logback and slf4j are you using? logback 1.0.6 (classic and core), slf4j-api 1.6.5
* Which flavor (and version) of Linux are you running? CentOS 5.8 and 6.3
* Does the same problem occur when you try your logback config in a simple HelloWorld app (outside of install4j)? Just tried it with creating a standalone jar from maven (jar-with-dependencies) and its working as expected but its embedded now. will check this in a few moments.
Regards, Oli
2012/8/27 Thorbjørn Ravn Andersen <thunderaxiom@hotmail.com>:
Have you enabled automatic printing of status messages in case of warming or errors?
(see http://logback.qos.ch/manual/configuration.html#automaticStatusPrinting)
It will go to your console.
From: logback-user-bounces@qos.ch [mailto:logback-user-bounces@qos.ch] On Behalf Of Tony Trinh Sent: 25. august 2012 23:57 To: logback users list Subject: Re: [logback-user] Problem with Logging in Linux
On Fri, Aug 24, 2012 at 6:52 AM, Oliver Zemann <oliver.zemann@gmail.com> wrote:
Hi, i have the absolut identical file for Windows which works as expected (logging), but not for linux:
http://rifers.org/paste/show/1801
There is just no logging - i started everything as root. Even when i use the FileAppender with its file name property set to "somelog.log" or "/root/somelog.log" it just saves nothing and i have no idea why.
I used updatedb && locate to find a file called like this but there was nothing. Also lsof with a grep find nothing opened. So it is really not logging.
Regards, Oli
Your config for the RollingFileAppender is missing the <file> element. The manual contains a good example of all the necessary elements [1]. logback should print a warning in the debug output for this.
It would be helpful if you provided additional details to reproduce the problem:
* What version of logback and slf4j are you using?
* Which flavor (and version) of Linux are you running?
* Does the same problem occur when you try your logback config in a simple HelloWorld app (outside of install4j)?
FYI, your logback config works (writes to a file) for me in Android.
It looks like Install4j supports a console [2], when running the installer with "-c". It might be worth seeing if logback's debug-output prints in that console.
[1]: http://logback.qos.ch/manual/appenders.html#logback-RollingTimeBased
[2]: http://www.ej-technologies.com/products/install4j/whatsnew4.html
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

IIRC, Logback looks for the XML file in your classpath. Maven gives you a lot of stuff for free (and via plugins) that you have to, if memory serves, manually do with ANT, e.g., copying certain files from the source directory to your build/target directory. --adam http://gordonizer.com On Mon, Aug 27, 2012 at 5:05 AM, Oliver Zemann <oliver.zemann@gmail.com>wrote:
I was able to easily get it working with maven when i copied the file into my resources folder, but it is not working with ant. Somehow it is not found, in that case all debugging options in the xml makes no sense as this is just not found.
I tested it with StatusPrinter and printing the LoggerContext:
run: 12:58:06.590 [main] ERROR com.logbackanttest.LogbackAntTest - ERROR 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy] 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml] 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.xml] 12:58:06,546 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Setting up default configuration.
I am currently in the project root directory, where a logback.xml is located. Also the dist folder (created by netbeans) contains a logback.xml and inside this dist folder the folder lib is created (containing the 3 jars, logback common, classic and slf4j) where also a logback.xml is located.
2012/8/27 Oliver Zemann <oliver.zemann@gmail.com>:
The problem is that the software is running productive on customer side, so there is no way to just deinstall the application and reinstall it...
* What version of logback and slf4j are you using? logback 1.0.6 (classic and core), slf4j-api 1.6.5
* Which flavor (and version) of Linux are you running? CentOS 5.8 and 6.3
* Does the same problem occur when you try your logback config in a simple HelloWorld app (outside of install4j)? Just tried it with creating a standalone jar from maven (jar-with-dependencies) and its working as expected but its embedded now. will check this in a few moments.
Regards, Oli
2012/8/27 Thorbjørn Ravn Andersen <thunderaxiom@hotmail.com>:
Have you enabled automatic printing of status messages in case of warming or errors?
(see http://logback.qos.ch/manual/configuration.html#automaticStatusPrinting )
It will go to your console.
From: logback-user-bounces@qos.ch [mailto:logback-user-bounces@qos.ch] On Behalf Of Tony Trinh Sent: 25. august 2012 23:57 To: logback users list Subject: Re: [logback-user] Problem with Logging in Linux
On Fri, Aug 24, 2012 at 6:52 AM, Oliver Zemann <oliver.zemann@gmail.com
wrote:
Hi, i have the absolut identical file for Windows which works as expected (logging), but not for linux:
http://rifers.org/paste/show/1801
There is just no logging - i started everything as root. Even when i use the FileAppender with its file name property set to "somelog.log" or "/root/somelog.log" it just saves nothing and i have no idea why.
I used updatedb && locate to find a file called like this but there was nothing. Also lsof with a grep find nothing opened. So it is really not logging.
Regards, Oli
Your config for the RollingFileAppender is missing the <file> element. The manual contains a good example of all the necessary elements [1]. logback should print a warning in the debug output for this.
It would be helpful if you provided additional details to reproduce the problem:
* What version of logback and slf4j are you using?
* Which flavor (and version) of Linux are you running?
* Does the same problem occur when you try your logback config in a simple HelloWorld app (outside of install4j)?
FYI, your logback config works (writes to a file) for me in Android.
It looks like Install4j supports a console [2], when running the installer with "-c". It might be worth seeing if logback's debug-output prints in that console.
[1]: http://logback.qos.ch/manual/appenders.html#logback-RollingTimeBased
[2]: http://www.ej-technologies.com/products/install4j/whatsnew4.html
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

How to reproduce: Create a new Java Application in Netbeans with following content: package com.logbackanttest; import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.core.util.StatusPrinter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; public class LogbackAntTest { private static final Logger LOG = LoggerFactory.getLogger(LogbackAntTest.class); /** * @param args the command line arguments */ public static void main(String[] args) { LOG.trace("TRACING"); LOG.error("ERROR"); LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); // print logback's internal status StatusPrinter.print(lc); } } Now try to get it working ;) I really tried alot, but it makes no difference where i copy the logback.xml into. I tried it with the dist/ folder, with the lib folder (which must be in the classpath, otherwise the application would not start at all). I have absolutly no idea whats going on - i guess with maven it just copies the logback.xml into the jar and uses that (i created a jar-with-dependencies). 2012/8/27 Oliver Zemann <oliver.zemann@gmail.com>:
I was able to easily get it working with maven when i copied the file into my resources folder, but it is not working with ant. Somehow it is not found, in that case all debugging options in the xml makes no sense as this is just not found.
I tested it with StatusPrinter and printing the LoggerContext:
run: 12:58:06.590 [main] ERROR com.logbackanttest.LogbackAntTest - ERROR 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy] 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml] 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.xml] 12:58:06,546 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Setting up default configuration.
I am currently in the project root directory, where a logback.xml is located. Also the dist folder (created by netbeans) contains a logback.xml and inside this dist folder the folder lib is created (containing the 3 jars, logback common, classic and slf4j) where also a logback.xml is located.
2012/8/27 Oliver Zemann <oliver.zemann@gmail.com>:
The problem is that the software is running productive on customer side, so there is no way to just deinstall the application and reinstall it...
* What version of logback and slf4j are you using? logback 1.0.6 (classic and core), slf4j-api 1.6.5
* Which flavor (and version) of Linux are you running? CentOS 5.8 and 6.3
* Does the same problem occur when you try your logback config in a simple HelloWorld app (outside of install4j)? Just tried it with creating a standalone jar from maven (jar-with-dependencies) and its working as expected but its embedded now. will check this in a few moments.
Regards, Oli
2012/8/27 Thorbjørn Ravn Andersen <thunderaxiom@hotmail.com>:
Have you enabled automatic printing of status messages in case of warming or errors?
(see http://logback.qos.ch/manual/configuration.html#automaticStatusPrinting)
It will go to your console.
From: logback-user-bounces@qos.ch [mailto:logback-user-bounces@qos.ch] On Behalf Of Tony Trinh Sent: 25. august 2012 23:57 To: logback users list Subject: Re: [logback-user] Problem with Logging in Linux
On Fri, Aug 24, 2012 at 6:52 AM, Oliver Zemann <oliver.zemann@gmail.com> wrote:
Hi, i have the absolut identical file for Windows which works as expected (logging), but not for linux:
http://rifers.org/paste/show/1801
There is just no logging - i started everything as root. Even when i use the FileAppender with its file name property set to "somelog.log" or "/root/somelog.log" it just saves nothing and i have no idea why.
I used updatedb && locate to find a file called like this but there was nothing. Also lsof with a grep find nothing opened. So it is really not logging.
Regards, Oli
Your config for the RollingFileAppender is missing the <file> element. The manual contains a good example of all the necessary elements [1]. logback should print a warning in the debug output for this.
It would be helpful if you provided additional details to reproduce the problem:
* What version of logback and slf4j are you using?
* Which flavor (and version) of Linux are you running?
* Does the same problem occur when you try your logback config in a simple HelloWorld app (outside of install4j)?
FYI, your logback config works (writes to a file) for me in Android.
It looks like Install4j supports a console [2], when running the installer with "-c". It might be worth seeing if logback's debug-output prints in that console.
[1]: http://logback.qos.ch/manual/appenders.html#logback-RollingTimeBased
[2]: http://www.ej-technologies.com/products/install4j/whatsnew4.html
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

The "lib" folder is generally not on the classpath; however, JARs within the folder are. If you know that other libraries are being successfully loaded from the "lib" folder, then one thing to try is to create a minimal JAR containing just logback.xml. The other option would be to just package logback.xml with the rest of your application code (which is what Maven does with items under src/main/resources by default). -Abraham On Mon, Aug 27, 2012 at 11:07 AM, Oliver Zemann <oliver.zemann@gmail.com>wrote:
How to reproduce:
Create a new Java Application in Netbeans with following content:
package com.logbackanttest;
import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.core.util.StatusPrinter; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
public class LogbackAntTest { private static final Logger LOG = LoggerFactory.getLogger(LogbackAntTest.class); /** * @param args the command line arguments */ public static void main(String[] args) { LOG.trace("TRACING"); LOG.error("ERROR"); LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); // print logback's internal status StatusPrinter.print(lc);
} }
Now try to get it working ;)
I really tried alot, but it makes no difference where i copy the logback.xml into. I tried it with the dist/ folder, with the lib folder (which must be in the classpath, otherwise the application would not start at all). I have absolutly no idea whats going on - i guess with maven it just copies the logback.xml into the jar and uses that (i created a jar-with-dependencies).
2012/8/27 Oliver Zemann <oliver.zemann@gmail.com>:
I was able to easily get it working with maven when i copied the file into my resources folder, but it is not working with ant. Somehow it is not found, in that case all debugging options in the xml makes no sense as this is just not found.
I tested it with StatusPrinter and printing the LoggerContext:
run: 12:58:06.590 [main] ERROR com.logbackanttest.LogbackAntTest - ERROR 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy] 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml] 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.xml] 12:58:06,546 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Setting up default configuration.
I am currently in the project root directory, where a logback.xml is located. Also the dist folder (created by netbeans) contains a logback.xml and inside this dist folder the folder lib is created (containing the 3 jars, logback common, classic and slf4j) where also a logback.xml is located.
2012/8/27 Oliver Zemann <oliver.zemann@gmail.com>:
The problem is that the software is running productive on customer side, so there is no way to just deinstall the application and reinstall it...
* What version of logback and slf4j are you using? logback 1.0.6 (classic and core), slf4j-api 1.6.5
* Which flavor (and version) of Linux are you running? CentOS 5.8 and 6.3
* Does the same problem occur when you try your logback config in a simple HelloWorld app (outside of install4j)? Just tried it with creating a standalone jar from maven (jar-with-dependencies) and its working as expected but its embedded now. will check this in a few moments.
Regards, Oli
2012/8/27 Thorbjørn Ravn Andersen <thunderaxiom@hotmail.com>:
Have you enabled automatic printing of status messages in case of warming or errors?
(see
http://logback.qos.ch/manual/configuration.html#automaticStatusPrinting)
It will go to your console.
From: logback-user-bounces@qos.ch [mailto:logback-user-bounces@qos.ch]
On
Behalf Of Tony Trinh Sent: 25. august 2012 23:57 To: logback users list Subject: Re: [logback-user] Problem with Logging in Linux
On Fri, Aug 24, 2012 at 6:52 AM, Oliver Zemann < oliver.zemann@gmail.com> wrote:
Hi, i have the absolut identical file for Windows which works as expected (logging), but not for linux:
http://rifers.org/paste/show/1801
There is just no logging - i started everything as root. Even when i use the FileAppender with its file name property set to "somelog.log" or "/root/somelog.log" it just saves nothing and i have no idea why.
I used updatedb && locate to find a file called like this but there was nothing. Also lsof with a grep find nothing opened. So it is really not logging.
Regards, Oli
Your config for the RollingFileAppender is missing the <file> element. The manual contains a good example of all the necessary elements [1]. logback should print a warning in the debug output for this.
It would be helpful if you provided additional details to reproduce the problem:
* What version of logback and slf4j are you using?
* Which flavor (and version) of Linux are you running?
* Does the same problem occur when you try your logback config in a simple HelloWorld app (outside of install4j)?
FYI, your logback config works (writes to a file) for me in Android.
It looks like Install4j supports a console [2], when running the installer with "-c". It might be worth seeing if logback's debug-output prints in that console.
[1]: http://logback.qos.ch/manual/appenders.html#logback-RollingTimeBased
[2]: http://www.ej-technologies.com/products/install4j/whatsnew4.html
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

The problem is that its not reliable to put the logback.xml into the jar. Is there a way to do that with command line? I tried with java -cp . -jar dist\AntTest.jar which was also not working. The logback.xml was located in . 2012/8/27 Abraham Lin <abraham.lin@post.harvard.edu>:
The "lib" folder is generally not on the classpath; however, JARs within the folder are. If you know that other libraries are being successfully loaded from the "lib" folder, then one thing to try is to create a minimal JAR containing just logback.xml. The other option would be to just package logback.xml with the rest of your application code (which is what Maven does with items under src/main/resources by default).
-Abraham
On Mon, Aug 27, 2012 at 11:07 AM, Oliver Zemann <oliver.zemann@gmail.com> wrote:
How to reproduce:
Create a new Java Application in Netbeans with following content:
package com.logbackanttest;
import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.core.util.StatusPrinter; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
public class LogbackAntTest { private static final Logger LOG = LoggerFactory.getLogger(LogbackAntTest.class); /** * @param args the command line arguments */ public static void main(String[] args) { LOG.trace("TRACING"); LOG.error("ERROR"); LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); // print logback's internal status StatusPrinter.print(lc);
} }
Now try to get it working ;)
I really tried alot, but it makes no difference where i copy the logback.xml into. I tried it with the dist/ folder, with the lib folder (which must be in the classpath, otherwise the application would not start at all). I have absolutly no idea whats going on - i guess with maven it just copies the logback.xml into the jar and uses that (i created a jar-with-dependencies).
2012/8/27 Oliver Zemann <oliver.zemann@gmail.com>:
I was able to easily get it working with maven when i copied the file into my resources folder, but it is not working with ant. Somehow it is not found, in that case all debugging options in the xml makes no sense as this is just not found.
I tested it with StatusPrinter and printing the LoggerContext:
run: 12:58:06.590 [main] ERROR com.logbackanttest.LogbackAntTest - ERROR 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy] 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml] 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.xml] 12:58:06,546 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Setting up default configuration.
I am currently in the project root directory, where a logback.xml is located. Also the dist folder (created by netbeans) contains a logback.xml and inside this dist folder the folder lib is created (containing the 3 jars, logback common, classic and slf4j) where also a logback.xml is located.
2012/8/27 Oliver Zemann <oliver.zemann@gmail.com>:
The problem is that the software is running productive on customer side, so there is no way to just deinstall the application and reinstall it...
* What version of logback and slf4j are you using? logback 1.0.6 (classic and core), slf4j-api 1.6.5
* Which flavor (and version) of Linux are you running? CentOS 5.8 and 6.3
* Does the same problem occur when you try your logback config in a simple HelloWorld app (outside of install4j)? Just tried it with creating a standalone jar from maven (jar-with-dependencies) and its working as expected but its embedded now. will check this in a few moments.
Regards, Oli
2012/8/27 Thorbjørn Ravn Andersen <thunderaxiom@hotmail.com>:
Have you enabled automatic printing of status messages in case of warming or errors?
(see
http://logback.qos.ch/manual/configuration.html#automaticStatusPrinting)
It will go to your console.
From: logback-user-bounces@qos.ch [mailto:logback-user-bounces@qos.ch] On Behalf Of Tony Trinh Sent: 25. august 2012 23:57 To: logback users list Subject: Re: [logback-user] Problem with Logging in Linux
On Fri, Aug 24, 2012 at 6:52 AM, Oliver Zemann <oliver.zemann@gmail.com> wrote:
Hi, i have the absolut identical file for Windows which works as expected (logging), but not for linux:
http://rifers.org/paste/show/1801
There is just no logging - i started everything as root. Even when i use the FileAppender with its file name property set to "somelog.log" or "/root/somelog.log" it just saves nothing and i have no idea why.
I used updatedb && locate to find a file called like this but there was nothing. Also lsof with a grep find nothing opened. So it is really not logging.
Regards, Oli
Your config for the RollingFileAppender is missing the <file> element. The manual contains a good example of all the necessary elements [1]. logback should print a warning in the debug output for this.
It would be helpful if you provided additional details to reproduce the problem:
* What version of logback and slf4j are you using?
* Which flavor (and version) of Linux are you running?
* Does the same problem occur when you try your logback config in a simple HelloWorld app (outside of install4j)?
FYI, your logback config works (writes to a file) for me in Android.
It looks like Install4j supports a console [2], when running the installer with "-c". It might be worth seeing if logback's debug-output prints in that console.
[1]: http://logback.qos.ch/manual/appenders.html#logback-RollingTimeBased
[2]: http://www.ej-technologies.com/products/install4j/whatsnew4.html
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

I could be wrong, but I seem to recall that you cannot use the -cp flag when using -jar. I think it tries to get the classpath from the JAR's manifest. --adam http://gordonizer.com On Mon, Aug 27, 2012 at 10:15 AM, Oliver Zemann <oliver.zemann@gmail.com>wrote:
The problem is that its not reliable to put the logback.xml into the jar. Is there a way to do that with command line? I tried with java -cp . -jar dist\AntTest.jar which was also not working. The logback.xml was located in .
2012/8/27 Abraham Lin <abraham.lin@post.harvard.edu>:
The "lib" folder is generally not on the classpath; however, JARs within the folder are. If you know that other libraries are being successfully loaded from the "lib" folder, then one thing to try is to create a minimal JAR containing just logback.xml. The other option would be to just package logback.xml with the rest of your application code (which is what Maven does with items under src/main/resources by default).
-Abraham
On Mon, Aug 27, 2012 at 11:07 AM, Oliver Zemann <oliver.zemann@gmail.com
wrote:
How to reproduce:
Create a new Java Application in Netbeans with following content:
package com.logbackanttest;
import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.core.util.StatusPrinter; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
public class LogbackAntTest { private static final Logger LOG = LoggerFactory.getLogger(LogbackAntTest.class); /** * @param args the command line arguments */ public static void main(String[] args) { LOG.trace("TRACING"); LOG.error("ERROR"); LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); // print logback's internal status StatusPrinter.print(lc);
} }
Now try to get it working ;)
I really tried alot, but it makes no difference where i copy the logback.xml into. I tried it with the dist/ folder, with the lib folder (which must be in the classpath, otherwise the application would not start at all). I have absolutly no idea whats going on - i guess with maven it just copies the logback.xml into the jar and uses that (i created a jar-with-dependencies).
2012/8/27 Oliver Zemann <oliver.zemann@gmail.com>:
I was able to easily get it working with maven when i copied the file into my resources folder, but it is not working with ant. Somehow it is not found, in that case all debugging options in the xml makes no sense as this is just not found.
I tested it with StatusPrinter and printing the LoggerContext:
run: 12:58:06.590 [main] ERROR com.logbackanttest.LogbackAntTest - ERROR 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy] 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml] 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.xml] 12:58:06,546 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Setting up default configuration.
I am currently in the project root directory, where a logback.xml is located. Also the dist folder (created by netbeans) contains a logback.xml and inside this dist folder the folder lib is created (containing the 3 jars, logback common, classic and slf4j) where also a logback.xml is located.
2012/8/27 Oliver Zemann <oliver.zemann@gmail.com>:
The problem is that the software is running productive on customer side, so there is no way to just deinstall the application and reinstall it...
* What version of logback and slf4j are you using? logback 1.0.6 (classic and core), slf4j-api 1.6.5
* Which flavor (and version) of Linux are you running? CentOS 5.8 and 6.3
* Does the same problem occur when you try your logback config in a simple HelloWorld app (outside of install4j)? Just tried it with creating a standalone jar from maven (jar-with-dependencies) and its working as expected but its embedded now. will check this in a few moments.
Regards, Oli
2012/8/27 Thorbjørn Ravn Andersen <thunderaxiom@hotmail.com>:
Have you enabled automatic printing of status messages in case of warming or errors?
(see
http://logback.qos.ch/manual/configuration.html#automaticStatusPrinting)
It will go to your console.
From: logback-user-bounces@qos.ch [mailto:
logback-user-bounces@qos.ch]
On Behalf Of Tony Trinh Sent: 25. august 2012 23:57 To: logback users list Subject: Re: [logback-user] Problem with Logging in Linux
On Fri, Aug 24, 2012 at 6:52 AM, Oliver Zemann <oliver.zemann@gmail.com> wrote:
Hi, i have the absolut identical file for Windows which works as expected (logging), but not for linux:
http://rifers.org/paste/show/1801
There is just no logging - i started everything as root. Even when i use the FileAppender with its file name property set to "somelog.log" or "/root/somelog.log" it just saves nothing and i have no idea why.
I used updatedb && locate to find a file called like this but there was nothing. Also lsof with a grep find nothing opened. So it is really not logging.
Regards, Oli
Your config for the RollingFileAppender is missing the <file> element. The manual contains a good example of all the necessary elements [1]. logback should print a warning in the debug output for this.
It would be helpful if you provided additional details to reproduce the problem:
* What version of logback and slf4j are you using?
* Which flavor (and version) of Linux are you running?
* Does the same problem occur when you try your logback config in a simple HelloWorld app (outside of install4j)?
FYI, your logback config works (writes to a file) for me in Android.
It looks like Install4j supports a console [2], when running the installer with "-c". It might be worth seeing if logback's debug-output prints in that console.
[1]:
http://logback.qos.ch/manual/appenders.html#logback-RollingTimeBased
[2]:
http://www.ej-technologies.com/products/install4j/whatsnew4.html
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user

You can use jar uf yourJarfilename logback.xml command to add logback.xml or logback.groovy to your jar. This issue I met before. The root cause is logback.xml not in your class path ________________________________ From: logback-user-bounces@qos.ch [mailto:logback-user-bounces@qos.ch] On Behalf Of Adam Gordon Sent: Monday, August 27, 2012 1:33 PM To: logback users list Subject: Re: [logback-user] Problem with Logging in Linux I could be wrong, but I seem to recall that you cannot use the -cp flag when using -jar. I think it tries to get the classpath from the JAR's manifest. --adam http://gordonizer.com On Mon, Aug 27, 2012 at 10:15 AM, Oliver Zemann <oliver.zemann@gmail.com<mailto:oliver.zemann@gmail.com>> wrote: The problem is that its not reliable to put the logback.xml into the jar. Is there a way to do that with command line? I tried with java -cp . -jar dist\AntTest.jar which was also not working. The logback.xml was located in . 2012/8/27 Abraham Lin <abraham.lin@post.harvard.edu<mailto:abraham.lin@post.harvard.edu>>:
The "lib" folder is generally not on the classpath; however, JARs within the folder are. If you know that other libraries are being successfully loaded from the "lib" folder, then one thing to try is to create a minimal JAR containing just logback.xml. The other option would be to just package logback.xml with the rest of your application code (which is what Maven does with items under src/main/resources by default).
-Abraham
On Mon, Aug 27, 2012 at 11:07 AM, Oliver Zemann <oliver.zemann@gmail.com<mailto:oliver.zemann@gmail.com>> wrote:
How to reproduce:
Create a new Java Application in Netbeans with following content:
package com.logbackanttest;
import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.core.util.StatusPrinter; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
public class LogbackAntTest { private static final Logger LOG = LoggerFactory.getLogger(LogbackAntTest.class); /** * @param args the command line arguments */ public static void main(String[] args) { LOG.trace("TRACING"); LOG.error("ERROR"); LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); // print logback's internal status StatusPrinter.print(lc);
} }
Now try to get it working ;)
I really tried alot, but it makes no difference where i copy the logback.xml into. I tried it with the dist/ folder, with the lib folder (which must be in the classpath, otherwise the application would not start at all). I have absolutly no idea whats going on - i guess with maven it just copies the logback.xml into the jar and uses that (i created a jar-with-dependencies).
2012/8/27 Oliver Zemann <oliver.zemann@gmail.com<mailto:oliver.zemann@gmail.com>>:
I was able to easily get it working with maven when i copied the file into my resources folder, but it is not working with ant. Somehow it is not found, in that case all debugging options in the xml makes no sense as this is just not found.
I tested it with StatusPrinter and printing the LoggerContext:
run: 12:58:06.590 [main] ERROR com.logbackanttest.LogbackAntTest - ERROR 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy] 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml] 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.xml] 12:58:06,546 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Setting up default configuration.
I am currently in the project root directory, where a logback.xml is located. Also the dist folder (created by netbeans) contains a logback.xml and inside this dist folder the folder lib is created (containing the 3 jars, logback common, classic and slf4j) where also a logback.xml is located.
2012/8/27 Oliver Zemann <oliver.zemann@gmail.com<mailto:oliver.zemann@gmail.com>>:
The problem is that the software is running productive on customer side, so there is no way to just deinstall the application and reinstall it...
* What version of logback and slf4j are you using? logback 1.0.6 (classic and core), slf4j-api 1.6.5
* Which flavor (and version) of Linux are you running? CentOS 5.8 and 6.3
* Does the same problem occur when you try your logback config in a simple HelloWorld app (outside of install4j)? Just tried it with creating a standalone jar from maven (jar-with-dependencies) and its working as expected but its embedded now. will check this in a few moments.
Regards, Oli
2012/8/27 Thorbjørn Ravn Andersen <thunderaxiom@hotmail.com<mailto:thunderaxiom@hotmail.com>>:
Have you enabled automatic printing of status messages in case of warming or errors?
(see
http://logback.qos.ch/manual/configuration.html#automaticStatusPrinting)
It will go to your console.
From: logback-user-bounces@qos.ch<mailto:logback-user-bounces@qos.ch> [mailto:logback-user-bounces@qos.ch<mailto:logback-user-bounces@qos.ch>] On Behalf Of Tony Trinh Sent: 25. august 2012 23:57 To: logback users list Subject: Re: [logback-user] Problem with Logging in Linux
On Fri, Aug 24, 2012 at 6:52 AM, Oliver Zemann <oliver.zemann@gmail.com<mailto:oliver.zemann@gmail.com>> wrote:
Hi, i have the absolut identical file for Windows which works as expected (logging), but not for linux:
http://rifers.org/paste/show/1801
There is just no logging - i started everything as root. Even when i use the FileAppender with its file name property set to "somelog.log" or "/root/somelog.log" it just saves nothing and i have no idea why.
I used updatedb && locate to find a file called like this but there was nothing. Also lsof with a grep find nothing opened. So it is really not logging.
Regards, Oli
Your config for the RollingFileAppender is missing the <file> element. The manual contains a good example of all the necessary elements [1]. logback should print a warning in the debug output for this.
It would be helpful if you provided additional details to reproduce the problem:
* What version of logback and slf4j are you using?
* Which flavor (and version) of Linux are you running?
* Does the same problem occur when you try your logback config in a simple HelloWorld app (outside of install4j)?
FYI, your logback config works (writes to a file) for me in Android.
It looks like Install4j supports a console [2], when running the installer with "-c". It might be worth seeing if logback's debug-output prints in that console.
[1]: http://logback.qos.ch/manual/appenders.html#logback-RollingTimeBased
[2]: http://www.ej-technologies.com/products/install4j/whatsnew4.html
_______________________________________________ Logback-user mailing list Logback-user@qos.ch<mailto:Logback-user@qos.ch> http://mailman.qos.ch/mailman/listinfo/logback-user
Logback-user mailing list Logback-user@qos.ch<mailto:Logback-user@qos.ch> http://mailman.qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list Logback-user@qos.ch<mailto:Logback-user@qos.ch> http://mailman.qos.ch/mailman/listinfo/logback-user
Logback-user mailing list Logback-user@qos.ch<mailto:Logback-user@qos.ch> http://mailman.qos.ch/mailman/listinfo/logback-user

Let's say you logback.xml is in the lib folder and lib folder full path suppose as "/opt/TestApp/lib" Your classpath should include /opt/testApp/lib ________________________________ From: logback-user-bounces@qos.ch [mailto:logback-user-bounces@qos.ch] On Behalf Of Adam Gordon Sent: Monday, August 27, 2012 1:33 PM To: logback users list Subject: Re: [logback-user] Problem with Logging in Linux I could be wrong, but I seem to recall that you cannot use the -cp flag when using -jar. I think it tries to get the classpath from the JAR's manifest. --adam http://gordonizer.com On Mon, Aug 27, 2012 at 10:15 AM, Oliver Zemann <oliver.zemann@gmail.com<mailto:oliver.zemann@gmail.com>> wrote: The problem is that its not reliable to put the logback.xml into the jar. Is there a way to do that with command line? I tried with java -cp . -jar dist\AntTest.jar which was also not working. The logback.xml was located in . 2012/8/27 Abraham Lin <abraham.lin@post.harvard.edu<mailto:abraham.lin@post.harvard.edu>>:
The "lib" folder is generally not on the classpath; however, JARs within the folder are. If you know that other libraries are being successfully loaded from the "lib" folder, then one thing to try is to create a minimal JAR containing just logback.xml. The other option would be to just package logback.xml with the rest of your application code (which is what Maven does with items under src/main/resources by default).
-Abraham
On Mon, Aug 27, 2012 at 11:07 AM, Oliver Zemann <oliver.zemann@gmail.com<mailto:oliver.zemann@gmail.com>> wrote:
How to reproduce:
Create a new Java Application in Netbeans with following content:
package com.logbackanttest;
import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.core.util.StatusPrinter; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
public class LogbackAntTest { private static final Logger LOG = LoggerFactory.getLogger(LogbackAntTest.class); /** * @param args the command line arguments */ public static void main(String[] args) { LOG.trace("TRACING"); LOG.error("ERROR"); LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); // print logback's internal status StatusPrinter.print(lc);
} }
Now try to get it working ;)
I really tried alot, but it makes no difference where i copy the logback.xml into. I tried it with the dist/ folder, with the lib folder (which must be in the classpath, otherwise the application would not start at all). I have absolutly no idea whats going on - i guess with maven it just copies the logback.xml into the jar and uses that (i created a jar-with-dependencies).
2012/8/27 Oliver Zemann <oliver.zemann@gmail.com<mailto:oliver.zemann@gmail.com>>:
I was able to easily get it working with maven when i copied the file into my resources folder, but it is not working with ant. Somehow it is not found, in that case all debugging options in the xml makes no sense as this is just not found.
I tested it with StatusPrinter and printing the LoggerContext:
run: 12:58:06.590 [main] ERROR com.logbackanttest.LogbackAntTest - ERROR 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy] 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml] 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.xml] 12:58:06,546 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Setting up default configuration.
I am currently in the project root directory, where a logback.xml is located. Also the dist folder (created by netbeans) contains a logback.xml and inside this dist folder the folder lib is created (containing the 3 jars, logback common, classic and slf4j) where also a logback.xml is located.
2012/8/27 Oliver Zemann <oliver.zemann@gmail.com<mailto:oliver.zemann@gmail.com>>:
The problem is that the software is running productive on customer side, so there is no way to just deinstall the application and reinstall it...
* What version of logback and slf4j are you using? logback 1.0.6 (classic and core), slf4j-api 1.6.5
* Which flavor (and version) of Linux are you running? CentOS 5.8 and 6.3
* Does the same problem occur when you try your logback config in a simple HelloWorld app (outside of install4j)? Just tried it with creating a standalone jar from maven (jar-with-dependencies) and its working as expected but its embedded now. will check this in a few moments.
Regards, Oli
2012/8/27 Thorbjørn Ravn Andersen <thunderaxiom@hotmail.com<mailto:thunderaxiom@hotmail.com>>:
Have you enabled automatic printing of status messages in case of warming or errors?
(see
http://logback.qos.ch/manual/configuration.html#automaticStatusPrinting)
It will go to your console.
From: logback-user-bounces@qos.ch<mailto:logback-user-bounces@qos.ch> [mailto:logback-user-bounces@qos.ch<mailto:logback-user-bounces@qos.ch>] On Behalf Of Tony Trinh Sent: 25. august 2012 23:57 To: logback users list Subject: Re: [logback-user] Problem with Logging in Linux
On Fri, Aug 24, 2012 at 6:52 AM, Oliver Zemann <oliver.zemann@gmail.com<mailto:oliver.zemann@gmail.com>> wrote:
Hi, i have the absolut identical file for Windows which works as expected (logging), but not for linux:
http://rifers.org/paste/show/1801
There is just no logging - i started everything as root. Even when i use the FileAppender with its file name property set to "somelog.log" or "/root/somelog.log" it just saves nothing and i have no idea why.
I used updatedb && locate to find a file called like this but there was nothing. Also lsof with a grep find nothing opened. So it is really not logging.
Regards, Oli
Your config for the RollingFileAppender is missing the <file> element. The manual contains a good example of all the necessary elements [1]. logback should print a warning in the debug output for this.
It would be helpful if you provided additional details to reproduce the problem:
* What version of logback and slf4j are you using?
* Which flavor (and version) of Linux are you running?
* Does the same problem occur when you try your logback config in a simple HelloWorld app (outside of install4j)?
FYI, your logback config works (writes to a file) for me in Android.
It looks like Install4j supports a console [2], when running the installer with "-c". It might be worth seeing if logback's debug-output prints in that console.
[1]: http://logback.qos.ch/manual/appenders.html#logback-RollingTimeBased
[2]: http://www.ej-technologies.com/products/install4j/whatsnew4.html
_______________________________________________ Logback-user mailing list Logback-user@qos.ch<mailto:Logback-user@qos.ch> http://mailman.qos.ch/mailman/listinfo/logback-user
Logback-user mailing list Logback-user@qos.ch<mailto:Logback-user@qos.ch> http://mailman.qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list Logback-user@qos.ch<mailto:Logback-user@qos.ch> http://mailman.qos.ch/mailman/listinfo/logback-user
Logback-user mailing list Logback-user@qos.ch<mailto:Logback-user@qos.ch> http://mailman.qos.ch/mailman/listinfo/logback-user

I added the directory of the project to the libraries (in Netbeans) and it was working as expected. Now i need to find a way how i can configure this (extending classpath that the logback.xml is found) in the productive system. Thanks! 2012/8/27 Wu, Jun 2 <Jun2.Wu@cibc.com>:
Let's say you logback.xml is in the lib folder and lib folder full path suppose as "/opt/TestApp/lib"
Your classpath should include /opt/testApp/lib
________________________________
From: logback-user-bounces@qos.ch [mailto:logback-user-bounces@qos.ch] On Behalf Of Adam Gordon
Sent: Monday, August 27, 2012 1:33 PM To: logback users list Subject: Re: [logback-user] Problem with Logging in Linux
I could be wrong, but I seem to recall that you cannot use the -cp flag when using -jar. I think it tries to get the classpath from the JAR's manifest.
--adam
On Mon, Aug 27, 2012 at 10:15 AM, Oliver Zemann <oliver.zemann@gmail.com> wrote:
The problem is that its not reliable to put the logback.xml into the jar. Is there a way to do that with command line? I tried with java -cp . -jar dist\AntTest.jar which was also not working. The logback.xml was located in .
2012/8/27 Abraham Lin <abraham.lin@post.harvard.edu>:
The "lib" folder is generally not on the classpath; however, JARs within the folder are. If you know that other libraries are being successfully loaded from the "lib" folder, then one thing to try is to create a minimal JAR containing just logback.xml. The other option would be to just package logback.xml with the rest of your application code (which is what Maven does with items under src/main/resources by default).
-Abraham
On Mon, Aug 27, 2012 at 11:07 AM, Oliver Zemann <oliver.zemann@gmail.com> wrote:
How to reproduce:
Create a new Java Application in Netbeans with following content:
package com.logbackanttest;
import ch.qos.logback.classic.LoggerContext; import ch.qos.logback.core.util.StatusPrinter; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
public class LogbackAntTest { private static final Logger LOG = LoggerFactory.getLogger(LogbackAntTest.class); /** * @param args the command line arguments */ public static void main(String[] args) { LOG.trace("TRACING"); LOG.error("ERROR"); LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory(); // print logback's internal status StatusPrinter.print(lc);
} }
Now try to get it working ;)
I really tried alot, but it makes no difference where i copy the logback.xml into. I tried it with the dist/ folder, with the lib folder (which must be in the classpath, otherwise the application would not start at all). I have absolutly no idea whats going on - i guess with maven it just copies the logback.xml into the jar and uses that (i created a jar-with-dependencies).
2012/8/27 Oliver Zemann <oliver.zemann@gmail.com>:
I was able to easily get it working with maven when i copied the file into my resources folder, but it is not working with ant. Somehow it is not found, in that case all debugging options in the xml makes no sense as this is just not found.
I tested it with StatusPrinter and printing the LoggerContext:
run: 12:58:06.590 [main] ERROR com.logbackanttest.LogbackAntTest - ERROR 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy] 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml] 12:58:06,545 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.xml] 12:58:06,546 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Setting up default configuration.
I am currently in the project root directory, where a logback.xml is located. Also the dist folder (created by netbeans) contains a logback.xml and inside this dist folder the folder lib is created (containing the 3 jars, logback common, classic and slf4j) where also a logback.xml is located.
2012/8/27 Oliver Zemann <oliver.zemann@gmail.com>:
The problem is that the software is running productive on customer side, so there is no way to just deinstall the application and reinstall it...
* What version of logback and slf4j are you using? logback 1.0.6 (classic and core), slf4j-api 1.6.5
* Which flavor (and version) of Linux are you running? CentOS 5.8 and 6.3
* Does the same problem occur when you try your logback config in a simple HelloWorld app (outside of install4j)? Just tried it with creating a standalone jar from maven (jar-with-dependencies) and its working as expected but its embedded now. will check this in a few moments.
Regards, Oli
2012/8/27 Thorbjørn Ravn Andersen <thunderaxiom@hotmail.com>:
Have you enabled automatic printing of status messages in case of warming or errors?
(see
http://logback.qos.ch/manual/configuration.html#automaticStatusPrinting)
It will go to your console.
From: logback-user-bounces@qos.ch [mailto:logback-user-bounces@qos.ch] On Behalf Of Tony Trinh Sent: 25. august 2012 23:57 To: logback users list Subject: Re: [logback-user] Problem with Logging in Linux
On Fri, Aug 24, 2012 at 6:52 AM, Oliver Zemann <oliver.zemann@gmail.com> wrote:
Hi, i have the absolut identical file for Windows which works as expected (logging), but not for linux:
http://rifers.org/paste/show/1801
There is just no logging - i started everything as root. Even when i use the FileAppender with its file name property set to "somelog.log" or "/root/somelog.log" it just saves nothing and i have no idea why.
I used updatedb && locate to find a file called like this but there was nothing. Also lsof with a grep find nothing opened. So it is really not logging.
Regards, Oli
Your config for the RollingFileAppender is missing the <file> element. The manual contains a good example of all the necessary elements [1]. logback should print a warning in the debug output for this.
It would be helpful if you provided additional details to reproduce the problem:
* What version of logback and slf4j are you using?
* Which flavor (and version) of Linux are you running?
* Does the same problem occur when you try your logback config in a simple HelloWorld app (outside of install4j)?
FYI, your logback config works (writes to a file) for me in Android.
It looks like Install4j supports a console [2], when running the installer with "-c". It might be worth seeing if logback's debug-output prints in that console.
[1]: http://logback.qos.ch/manual/appenders.html#logback-RollingTimeBased
[2]: http://www.ej-technologies.com/products/install4j/whatsnew4.html
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
_______________________________________________ Logback-user mailing list Logback-user@qos.ch http://mailman.qos.ch/mailman/listinfo/logback-user
participants (7)
-
Abraham Lin
-
Adam Gordon
-
ceki
-
Oliver Zemann
-
Thorbjørn Ravn Andersen
-
Tony Trinh
-
Wu, Jun 2