Uploaded image for project: 'TomEE'
  1. TomEE
  2. TOMEE-1631

Basic Rotating JUL Handler

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.3, 7.0.0-M1
    • Component/s: None
    • Labels:
      None
    • Environment:
      Supporting rotation by day AND size, archiving of old logs and purge of old archives.

      Description

      Doc:

      NOTE: for simplicity the prefix `org.apache.tomee.jul.handler.rotating.LocalFileHandler.` has been removed of name columns.

      Name Default Value Description
      filenamePattern ${catalina.base}/logs/logs.%s.%03d.log where log files are created, it uses String.format() and gives you the date and file number - in this order.
      limit 10 Megabytes limit size indicating the file should be rotated
      dateCheckInterval 5 seconds how often the date should be computed to rotate the file (don't do it each time for performances reason, means you can get few records of next day in a file name with current day)
      bufferSize -1 bytes if positive the in memory buffer used to store data before flushing them to the disk
      encoding
      file encoding
      level ALL level this handler accepts
      filter
      filter used to check if the message should be logged
      formatter java.util.logging.SimpleFormatter formatter used to format messages
      archiveDirectory ${catalina.base}/logs/archives/ where compressed logs are put.
      archiveFormat gzip zip or gzip.
      archiveOlderThan -1 days how many days files are kept before being compressed
      purgeOlderThan -1 days how many days files are kept before being deleted, note: it applies on archives and not log files so 2 days of archiving and 3 days of purge makes it deleted after 5 days.
      compressionLevel -1 In case of zip archiving the zip compression level (-1 for off or 0-9).

      NOTE: archiving and purging are done only when a file is rotated, it means it can be ignored during days if there is no logging activity.

      NOTE: archiving and purging is done in a background thread pool, you can configure the number of threads in thanks to
      `org.apache.tomee.jul.handler.rotating.BackgroundTaskRunner.threads` property in `conf/logging.properties`.
      Default is 2 which should be fine for most applications.

        Attachments

          Activity

            People

            • Assignee:
              romain.manni-bucau Romain Manni-Bucau
              Reporter:
              romain.manni-bucau Romain Manni-Bucau
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: