Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.10
    • Fix Version/s: 1.2.11
    • Component/s: Appenders, Documentation
    • Labels:
      None

      Description

      http://logging.apache.org/log4net/release/config-examples.html
      The last code example under "RollingFileAppender" seems to be wrong. Shouldn't it be:

      <rollingStyle value="Once" />

        Activity

        Hide
        Ron Grabowski added a comment -

        I don't understand what the problem is. The xml snippet looks ok to me.

        Show
        Ron Grabowski added a comment - I don't understand what the problem is. The xml snippet looks ok to me.
        Hide
        Ansgar Flack added a comment -

        The xml snippet is well-formed but it doesn't match the text above.

        The documentation says:

        "This example show how to configure the RollingFileAppender to roll
        log files once per program execution."

        but in the snippet rollingStyle is set to "size"

        <rollingStyle value="Size" />

        shouldnt it be set to "once"?

        <rollingStyle value="Once" />

        With "Size" LOG4NET wasn't creating a new file everytime I started my program.

        Ansgar Flack

        Show
        Ansgar Flack added a comment - The xml snippet is well-formed but it doesn't match the text above. The documentation says: "This example show how to configure the RollingFileAppender to roll log files once per program execution." but in the snippet rollingStyle is set to "size" <rollingStyle value="Size" /> shouldnt it be set to "once"? <rollingStyle value="Once" /> With "Size" LOG4NET wasn't creating a new file everytime I started my program. Ansgar Flack
        Hide
        Ron Grabowski added a comment -

        Any time appendToFile is set to False (when either explicitly set or with rollingStyle=Once) a new file will be created when the application starts. The example is using rollingStyle=Size to illustrate that you can always roll a file even if you create a new one for each program start. Log files become difficult to manage when they get to be a couple hundred megabytes. Being able to roll those at regular intervals is always helpful. I'll see about making a simpler example.

        Show
        Ron Grabowski added a comment - Any time appendToFile is set to False (when either explicitly set or with rollingStyle=Once) a new file will be created when the application starts. The example is using rollingStyle=Size to illustrate that you can always roll a file even if you create a new one for each program start. Log files become difficult to manage when they get to be a couple hundred megabytes. Being able to roll those at regular intervals is always helpful. I'll see about making a simpler example.
        Hide
        Ron Grabowski added a comment -

        Fixed in r753479. Added additional documentation and example explaining the most basic way to get a once per application run log file is to set appendToFile=false (which is what rollingStyle=Once does).

        Show
        Ron Grabowski added a comment - Fixed in r753479. Added additional documentation and example explaining the most basic way to get a once per application run log file is to set appendToFile=false (which is what rollingStyle=Once does).

          People

          • Assignee:
            Ron Grabowski
            Reporter:
            Ansgar Flack
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development