François Dumont | 1 Oct 21:34 2008
Picon

Configuration system enhancement

Hi

    We are using log4net through out all our applications and are very 
happy with it. I would like to know however if you ever considered 
enhancing the configuration system. I would be especially interested in 
being able to fully initialize log4net programmatically. All the sample 
I have been able to find are always using an xml description but there 
are parameters we need to pass to a special appender we have develop 
that simply cannot be serialized.

Bests

François Dumont

Ron Grabowski | 1 Oct 22:58 2008
Picon

Re: Configuration system enhancement

Log4net can be configured progmatically. Have you looked at the test cases for examples?

----- Original Message ----
From: François Dumont <francois.cppdevs <at> free.fr>
To: log4net-dev <at> logging.apache.org
Sent: Wednesday, October 1, 2008 3:34:28 PM
Subject: Configuration system enhancement

Hi

    We are using log4net through out all our applications and are very 
happy with it. I would like to know however if you ever considered 
enhancing the configuration system. I would be especially interested in 
being able to fully initialize log4net programmatically. All the sample 
I have been able to find are always using an xml description but there 
are parameters we need to pass to a special appender we have develop 
that simply cannot be serialized.

Bests

François Dumont

Ron Grabowski | 2 Oct 23:17 2008
Picon

Re: Appender to run at a Schedule Time

Use a Timer?

// untested
public class AutoFlushSmtpAppender : SmtpAppender
{
    private System.Timers.Timer timer;

    private int interval;

    /// <summary>
    /// Flush interval in milliseconds.
    /// </summary>
    public int Interval
    {
        get { return interval; }
        set { interval = value; }
    }

    public override void ActivateOptions()
    {
        base.ActivateOptions();
        ErrorHandler = new StopTimerErrorHandler(this, ErrorHandler);

        timer = new Timer(Interval);
        timer.Elapsed += delegate { Flush(); };
        timer.Start();
    }

    protected override void OnClose()
    {
(Continue reading)

Nicklas Norling (JIRA | 4 Oct 15:19 2008
Picon

[jira] Created: (LOG4NET-176) Buildable with VS 2008 and .NET FW 3.5

Buildable with VS 2008 and .NET FW 3.5
--------------------------------------

                 Key: LOG4NET-176
                 URL: https://issues.apache.org/jira/browse/LOG4NET-176
             Project: Log4net
          Issue Type: New Feature
          Components: Builds
         Environment: Windows, log4net trunk, vs 2008 .net 3.5
            Reporter: Nicklas Norling
            Priority: Minor
             Fix For: v.Next

Providing a patch for the changes I'm using when compiling log4net locally using vs2008 and .net 3.5. The
patch is created against trunk  <at>  701632. It adds project and solution files for vs 2008, adds compilation
symbol NET_3_5 which is then added to all conditional compilation statements that have NET_2_0 today.
Also the AssemblyInfo.cs has a .NET 3.5 section added. Since the project files have to be manually updated
when new files are added to trunk I would appretiate it if this patch (or one with similar functions) where
added to trunk.

--

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Nicklas Norling (JIRA | 4 Oct 15:21 2008
Picon

[jira] Updated: (LOG4NET-176) Buildable with VS 2008 and .NET FW 3.5


     [
https://issues.apache.org/jira/browse/LOG4NET-176?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Nicklas Norling updated LOG4NET-176:
------------------------------------

    Attachment: Vs2k8.net35.patch

Patch against trunk for vs2008 and .net 3.5 buildability

> Buildable with VS 2008 and .NET FW 3.5
> --------------------------------------
>
>                 Key: LOG4NET-176
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-176
>             Project: Log4net
>          Issue Type: New Feature
>          Components: Builds
>         Environment: Windows, log4net trunk, vs 2008 .net 3.5
>            Reporter: Nicklas Norling
>            Priority: Minor
>             Fix For: v.Next
>
>         Attachments: Vs2k8.net35.patch
>
>
> Providing a patch for the changes I'm using when compiling log4net locally using vs2008 and .net 3.5. The
patch is created against trunk  <at>  701632. It adds project and solution files for vs 2008, adds compilation
symbol NET_3_5 which is then added to all conditional compilation statements that have NET_2_0 today.
(Continue reading)

anvy0314 (JIRA | 6 Oct 10:11 2008
Picon

[jira] Created: (LOG4NET-177) How to get the pattern convert string form layout?

How to get the pattern convert string form layout?
--------------------------------------------------

                 Key: LOG4NET-177
                 URL: https://issues.apache.org/jira/browse/LOG4NET-177
             Project: Log4net
          Issue Type: Test
    Affects Versions: 1.2.10
            Reporter: anvy0314

Hi, I want to get the whole string after pattern format, how to do it, thanks!

Like this string "2008-10-06 15:50:45,875 [192.168.7.103] DEBUG PingTestLogger..." before write to
the log file.

--

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Richard Nijkamp (JIRA | 6 Oct 10:37 2008
Picon

[jira] Created: (LOG4NET-178) Log4Net stops logging after appdomain recycle of aps.net2.0 application

Log4Net stops logging after appdomain recycle of aps.net2.0 application
-----------------------------------------------------------------------

                 Key: LOG4NET-178
                 URL: https://issues.apache.org/jira/browse/LOG4NET-178
             Project: Log4net
          Issue Type: Bug
          Components: Appenders
    Affects Versions: 1.2.10
         Environment: Windows server 2003
            Reporter: Richard Nijkamp

Dear sir/madam,

 We are using Log4Net 1.2.10. We encounter the problem that Log4net doesn't continue logging after an event
that triggers an appdomain recycle/restart.

 In the global.asax we start the logging with:

 private static readonly ILog log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);

Logging works flawless when the application is started for the first time. After sometime it might occur
that the appdomain gets recycled due to inactivity of the web application. We use the following code in Application_end():

log.Info("*** Application end ***");

log4net.LogManager.Shutdown();

After this function the application gets restarted and the Application_start() method executes and
writes new lines to the log. The problem is that the log4net doesn't write the new lines after the restart.
(Continue reading)

Shetal Shah (JIRA | 6 Oct 20:49 2008
Picon

[jira] Created: (LOG4NET-179) Log file does not get created by release version of App.exe

Log file does not get created by release version of App.exe
-----------------------------------------------------------

                 Key: LOG4NET-179
                 URL: https://issues.apache.org/jira/browse/LOG4NET-179
             Project: Log4net
          Issue Type: Test
    Affects Versions: 1.2.10
         Environment: Visual Studio 2005, language C#, OS Windows XP Professional
            Reporter: Shetal Shah

I have a windows application that uses log4net. 

My app.config section has
<log4net>
    <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
      <file value="nul" />
      <appendToFile value="false" />
      <rollingStyle value="Size" />
      <maxSizeRollBackups value="10" />
      <maximumFileSize value="2MB" />
      <layout type="log4net.Layout.PatternLayout">
        <param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" />
      </layout>
    </appender>
    <root>
      <level value="ALL" />
      <appender-ref ref="RollingFileAppender" />
      <appender-ref ref="UdpAppender" />
    </root>
(Continue reading)

François Dumont | 6 Oct 21:37 2008
Picon

Re: Configuration system enhancement

Well, I have looked at test cases and haven't found what I am trying to 
do. In fact I simply would like to know if you have ever considered 
adopting the .Net 2.0 ConfigurationSection system as for the moment 
log4net only use the IConfigurationSectionHandler. In a number of 
situations the ConfigurationSection would be more convenient. Here are 2 
use cases where I could have advantage of it:

- application specific log file:

    We are developing Windows services that can be instantiated numerous 
times, each service instance having its own name. All services are using 
the same log4net configuration file and we prefer to have all services 
log to the same 'logs' folder. So the problem is to specialize the log 
file name for each service. We do so thanks to an environment variable 
that each process has to set at startup containing the service name, the 
file name in the log4net config file contains a %ENV_VAR% that is 
automatically replaced when log4net starts.

- Custom appender with non serializable fields:

    We have a custom appender to perform asynchronous log. This appender 
creates for the moment its own thread to work but I would prefer to have 
the application creates it and assign it to the log4net appender. The 
only solution I found so far is to have some kind of thread singleton 
instance in the global scope of the application and then have the 
appender retrieve it at construction.

You see in both situation I have to rely on a global storage which is a 
design I always try to avoid because of the thread safety or maintenance 
problems that comes with it. The following configuration would be much 
(Continue reading)

Ayende Rahien (JIRA | 11 Oct 01:49 2008
Picon

[jira] Updated: (LOG4NET-64) [PATCH] to RollingFileAppender.cs to add the ability to preserve the log file name extension when rolling the log file.


     [
https://issues.apache.org/jira/browse/LOG4NET-64?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ayende Rahien updated LOG4NET-64:
---------------------------------

    Attachment: LOG4NET-64.patch

Updated patch

> [PATCH] to RollingFileAppender.cs to add the ability to preserve the log file name extension when
rolling the log file.
> -----------------------------------------------------------------------------------------------------------------------
>
>                 Key: LOG4NET-64
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-64
>             Project: Log4net
>          Issue Type: New Feature
>          Components: Appenders
>    Affects Versions: 1.2.9
>            Reporter: Joshua Bassett
>            Assignee: Ron Grabowski
>         Attachments: LOG4NET-64.patch, patch.txt
>
>
> Normally, when the log file is rolled the file name extension is not preserved.
> For example, file.log is rolled to file.log.1 or file.log.yyyy-MM-dd.
> However, this may not be desired in all cases and it may be necessary to preserve the log file name extension
when the log file is rolled. Most notably, this feature is useful for maintaining file associations under
(Continue reading)


Gmane