Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-1250

[2.5] CronTriggeringPolicy renaming behavior when midnight.

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Question
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.5
    • 2.6.2
    • Appenders
    • None

    Description

      Hi.
      I tried CrontriggeringPolicy(added 2.5) for save daily log files at midnight.
      My goal is, for example.
      if today is 2015/01/01, "http.log" <- active file.
      and when midnight, "http.log" will be renamed "http_20150101.log", and create new "http.log".

      But my problem is when midnight, "http.log" renamed "http_20150102.log"...
      I want to make that file's name "http_20150101.log" because that file has 2015/01/01's log,

      Here's my configure xml.

      <Routing name="routing_file">
        <Routes pattern="pattern1">
          <Route key="http">
            <RollingFile name="rolling_http" filename="${path}/http.log" filepattern="${path}/http_%d{yyyyMMdd}.log">
              <PatternLayout pattern="http"/>
              <CronTriggeringPolicy schedule="0 0 0 * * ?"/>
            </RollingFile>
          </Route>
        </Routes>
      </Routing>
      

      Please help me.
      Thanks for your help, I'm very appreciated it

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            rgoers Ralph Goers
            nonoriri lee yongjoong
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment