0 Replies Latest reply on Mar 22, 2010 10:25 PM by EDI

    [logging] Problems to configure logging rotation.

      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());
      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


      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
      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:
      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.