0 Replies Latest reply: Mar 22, 2010 5:25 PM by EDI RSS

    [logging] Problems to configure logging rotation.

    EDI
      Hi,
      I have an application .ear deployed in weblogic v10.3.1.0
      This application use java.util.logging to write a log file.
            fh = new FileHandler(logFileName,0,1,true);
            fh.setFormatter(new XMLFormatter());
            logger.addHandler(fh);
      FileHandler(String pattern, int limit, int count, boolean append)
      pattern - the pattern for naming the output file
      limit - the maximum number of bytes to write to any one file. If this is zero, then there is no limit. (Defaults to no limit).
      count - the number of files to use
      append - specifies append mode

      http://www.javadocexamples.com/java/util/logging/java.util.logging.FileHandler.html

      logFileName is dynamic with date formated like this yyyMMdd + ApplicationName + ".log"
      This file is created but I have also yyyyMMddSEC.log.1, yyyyMMddSEC.log.2, yyyyMMddSEC.log.3,...
      I DON'T WANT THESE FILES_, that's why I put limit to 0, count to 1 and append to true.
      This code works without jdev/weblogic but has not effect in weblogic.
      Q1. Why?


      So I go to Weblogic console: Domain Structure-> DefaultDomain->Logging
      Log file name: logs/DefaultDomain.log
      Rotation type: None
      NONE
      Messages accumulate in a single file.
      You must erase the contents of the file when the size is too large.
      Note that WebLogic Server sets a threshold size limit of 500 MB before it forces a hard rotation to prevent excessive log file growth.

      But it doesn't work, Weblogic continue to create log files like this *<filename>.log.<n>*
      Q2. Why?


      I have also created weblogic.xml in ViewControler/WEB-INF
      thanks to this documentation:
      http://download.oracle.com/docs/cd/E13222_01/wls/docs103/webapp/weblogic_xml.html#wp1063199
      but it doesn't work...again.
      Q3. Why?

      Q4. If I want applications manage themselves their log, how to deactivate the logging handler in weblogic (LogFileMBean?)

      Thanks for your help.