Uploaded image for project: 'Log4net'
  1. Log4net
  2. LOG4NET-589

Impossible to use ProcessExit event for logging needs

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None

      Description

      LoggerManager use ProcessExit event to run shutdown on each repository/loggers. If the user wants to use these events (ProcessExit or DomainUnload) also to log own data, he will meet the problem, since LoggerManager will shutdown all loggers first (log4net_nonworking.cs).

      There is a workaround when you can initialize logger in main method (showed in log4net_working.cs), but then all code loses readability.

       

      • It would be great if LoggerManager won't use ProcessExit and DomainUnload to shutdown loggers, since this event might be used in user application for own needs.
      • If you can not refuse these events, then it would be good to have a public method to reregister those events. User will add own delegates first and then reregister LoggerManager events.

        Attachments

        1. LoggerManager.cs
          30 kB
          Aleksandr Serbin
        2. log4net_working.cs
          0.9 kB
          Aleksandr Serbin
        3. log4net_nonworking.cs
          0.8 kB
          Aleksandr Serbin

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              Aleser Aleksandr Serbin
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: