Log4net
  1. Log4net
  2. LOG4NET-246

Make it possible to choose whether or not to watch configuration files specified using the "log4net.Config" appsetting key

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.10
    • Fix Version/s: 1.2.11
    • Component/s: Core

      Description

      Currently (v1.2.10) it is possible to specify a configuration file for log4net by adding a key like this in the host application's configuration <appSettings> section:
      <add key="log4net.Config" value="Log.config" />

      This defaults to invoking XmlConfigurator.Configure() on the file specified (log4net/Core/DefaultRepositorySelector.cs, line 725). This means the file is not watched for changes during program run time.

      It would be nice if there was some way similar to the above <appSettings> key to specify whether log4net should watch the file or not.

      I might propose that a new key is introduced in this fashion:
      <add key="log4net.Config.Watch" value="true" />

      This key would denote a bool value defaulting to false. The value would only be taken into consideration if the "log4net.Config" key is specified.

        Activity

        Hide
        Uri Goldstein added a comment -

        This is a patch to the v1.2.10 Core\DefaultRepositoriSelector.cs file. In it I've implemented watch functionality based on a new app setting called "log4net.Config.Web" as described in the issue itself.

        Show
        Uri Goldstein added a comment - This is a patch to the v1.2.10 Core\DefaultRepositoriSelector.cs file. In it I've implemented watch functionality based on a new app setting called "log4net.Config.Web" as described in the issue itself.
        Hide
        Uri Goldstein added a comment -

        What do I need to do to have this patch reviewed by log4net contributers and integrated?

        Show
        Uri Goldstein added a comment - What do I need to do to have this patch reviewed by log4net contributers and integrated?
        Hide
        Stefan Bodewig added a comment -

        Your patch is the wrong way around (you've mixed up old and new) but otherwise looks OK to me.

        Show
        Stefan Bodewig added a comment - Your patch is the wrong way around (you've mixed up old and new) but otherwise looks OK to me.
        Hide
        Stefan Bodewig added a comment -

        A tweaked version of your patch is in svn trunk now.

        Could you please also provide an update for the docs?

        Show
        Stefan Bodewig added a comment - A tweaked version of your patch is in svn trunk now. Could you please also provide an update for the docs?
        Hide
        Uri Goldstein added a comment -

        Will do.
        https://issues.apache.org/jira/browse/LOG4NET-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13101197#comment-13101197]
        specified using the "log4net.Config" appsetting key
        ---------------------------------------------------------------------------------------------------------------------------
        log4net by adding a key like this in the host application's configuration
        <appSettings> section:
        specified (log4net/Core/DefaultRepositorySelector.cs, line 725). This means
        the file is not watched for changes during program run time.
        key to specify whether log4net should watch the file or not.
        only be taken into consideration if the "log4net.Config" key is specified.

        Show
        Uri Goldstein added a comment - Will do. https://issues.apache.org/jira/browse/LOG4NET-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13101197#comment-13101197 ] specified using the "log4net.Config" appsetting key --------------------------------------------------------------------------------------------------------------------------- log4net by adding a key like this in the host application's configuration <appSettings> section: specified (log4net/Core/DefaultRepositorySelector.cs, line 725). This means the file is not watched for changes during program run time. key to specify whether log4net should watch the file or not. only be taken into consideration if the "log4net.Config" key is specified.
        Hide
        Stefan Bodewig added a comment -

        Docs added with svn revision 1178842

        Show
        Stefan Bodewig added a comment - Docs added with svn revision 1178842
        Hide
        Uri Goldstein added a comment -

        Thanks for adding the docs Stefan. Any further action required on my part?

        Show
        Uri Goldstein added a comment - Thanks for adding the docs Stefan. Any further action required on my part?
        Hide
        Stefan Bodewig added a comment -

        Thanks Uri. No, I think all is done now and the patch has been part of the 1.2.11 release.

        Show
        Stefan Bodewig added a comment - Thanks Uri. No, I think all is done now and the patch has been part of the 1.2.11 release.

          People

          • Assignee:
            Unassigned
            Reporter:
            Uri Goldstein
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development