#14 log4j does not work

closed
nobody
None
5
2009-07-18
2007-11-13
Carsten
No

How to configure log4j to work properly?

I Use Webdisk 0.44 on SLES10 an Logging does not work, although it is configured.

web.xml:
------------------------------------------------
<param-name>jcifsloglevel</param-name>
<param-value>10</param-value>

<param-name>log4jconf</param-name>
<param-value>log4j.properties</param-value>

log4j.properties:
------------------------------------------------
# Log4j configuration file.
log4j.debug=false

#
# Available levels are DEBUG, INFO, WARN, ERROR, FATAL
#

log4j.rootCategory=DEBUG, Daily

log4j.appender.Daily=org.apache.log4j.DailyRollingFileAppender
log4j.appender.Daily.file=log/log4j.log
log4j.appender.Daily.datePattern='.'yyyy-MM-dd
log4j.appender.Daily.append=true
log4j.appender.Daily.layout=org.apache.log4j.PatternLayout
log4j.appender.Daily.layout.ConversionPattern=%-5p %d{ISO8601} - %m%n

Within the jcifs.properties the is logging configured:
jcifs.util.loglevel=10
jcifs.encoding=Cp850
jcifs.resolveOrder=LMHOSTS,DNS
jcifs.smb.client.soTimeout=60000

What parameter for jcifs.util.loglevel will be used for logging:
web.xml or jcifs.properties?

Why is no logfile created?

Discussion

  • Thomas Bley

    Thomas Bley - 2007-12-02

    Logged In: YES
    user_id=922402
    Originator: NO

    Hello,

    <param-name>jcifsloglevel</param-name>
    <param-value>10</param-value>

    The jCIFS library does not use log4j. The jCIFS debugging output should be in catalina.out or the terminal window.

    The IntegraTUM WebDisk uses log4j for logging events like Download, Upload, etc.
    A file like jcifs.properties is not used. The relevant settings are made in web.xml (jcifsloglevel or jcifsencoding) or directly in Controller.java, see:

    conf = new Configs(getServletConfig());
    // set jCIFS loglevel, default: 2
    jcifs.util.LogStream.setLevel(conf.jcifsloglevel);
    jcifs.Config.setProperty( "jcifs.util.loglevel", String.valueOf(conf.jcifsloglevel) );

    // see http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html
    // some charsets are not supported in JRE, default is Cp850
    if (java.nio.charset.Charset.isSupported(conf.jCIFSencoding)) {
    jcifs.Config.setProperty( "jcifs.encoding", conf.jCIFSencoding );
    } else {
    System.out.println("[WebDisk] Charset not supported: "+conf.jCIFSencoding);
    jcifs.Config.setProperty( "jcifs.encoding", "Cp1252" );
    }
    jcifs.Config.setProperty( "jcifs.resolveOrder", "LMHOSTS,DNS" );
    jcifs.Config.setProperty( "jcifs.smb.client.soTimeout", "60000" );

    Please remember to restart the Tomcat server when changing the jCIFS loglevel.

    bye
    Thomas

     
  • Thomas Bley

    Thomas Bley - 2009-07-18
    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks