Ron Grabowski | 1 Apr 05:36 2009
Picon

Re: all the example files are missing from the log4net website


"
The following examples are only available in the log4net release download, not on-line. To obtain the
examples download one of the log4net releases. 
"

----- Original Message ----
From: Johan Compen <johanc <at> gmail.com>
To: log4net-dev <at> logging.apache.org
Sent: Tuesday, March 31, 2009 9:38:03 AM
Subject: all the example files are missing from the log4net website

All links on this page are dead:
http://logging.apache.org/log4net/release/example-apps.html

Not Found

The requested URL /examples/net/1.0/Tutorials/ConsoleApp/cs was not
found on this server.

Johan Compen | 1 Apr 11:28 2009
Picon

Re: all the example files are missing from the log4net website

Oops, I do'nt like reading I guess...
But still, people don't like webpages with dead links. Is it that hard to fix?

On Wed, Apr 1, 2009 at 5:36 AM, Ron Grabowski <rongrabowski <at> yahoo.com> wrote:
>
> "
> The following examples are only available in the log4net release download, not on-line. To obtain the
examples download one of the log4net releases.
> "
>
>
>
> ----- Original Message ----
> From: Johan Compen <johanc <at> gmail.com>
> To: log4net-dev <at> logging.apache.org
> Sent: Tuesday, March 31, 2009 9:38:03 AM
> Subject: all the example files are missing from the log4net website
>
> All links on this page are dead:
> http://logging.apache.org/log4net/release/example-apps.html
>
> Not Found
>
> The requested URL /examples/net/1.0/Tutorials/ConsoleApp/cs was not
> found on this server.
>
>

sundeep (JIRA | 12 Apr 13:42 2009
Picon

[jira] Created: (LOG4NET-211) Log4net with MS Access 2007 for asp.net 3.5 website

Log4net with MS Access 2007 for asp.net 3.5 website
---------------------------------------------------

                 Key: LOG4NET-211
                 URL: https://issues.apache.org/jira/browse/LOG4NET-211
             Project: Log4net
          Issue Type: Bug
          Components: Appenders
    Affects Versions: 1.2.10
         Environment: Windows XP, VS 2008, MS Access 2007
            Reporter: sundeep
             Fix For: 1.2.10

Hello,

I am using log4net for asp.net 3.5 website for logging exceptions into the MS Access 2007 (*accdb ). I had
done following settings:

1. Created log4net config file 

<?xml version="1.0" encoding="utf-8" ?>
<log4net debug="false">
  <appender name="AdoNetAppender_Access" type="log4net.Appender.AdoNetAppender">
    <connectionString value="Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=|DataDirectory|EAlog.accdb;Persist Security Info=False;" />
    <commandText value="INSERT INTO Logs ([LogDate],[Thread],[Level],[Logger],[Message]) VALUES
( <at> LogDate,  <at> Thread,  <at> Level,  <at> Logger,  <at> Message)" />
    <parameter>
      <parameterName value=" <at> LogDate" />
      <dbType value="String" />
(Continue reading)

Henry Padilla | 13 Apr 15:22 2009
Picon

How do I debug why I'm not getting a file log?

I'm using the RollingFileAppender and I have it configured like so:
        <appender name="RollingFileAppender" type="log4net.Appender.RollingFileAppender">
            <file value="\log.txt" />
            <appendToFile value="true" />
            <rollingStyle value="Size" />
            <maxSizeRollBackups value="10" />
            <maximumFileSize value="500KB" />
            <staticLogFileName value="true" />
            <layout type="log4net.Layout.PatternLayout">
                <conversionPattern value="*~~~*%newline%date Thread:[%thread] Level:%-5level Logger:%logger Method:%method %newline :%message %newline" />
            </layout>
        </appender>

I have the root debugger set like so:
        <root>
            <level value="DEBUG" />
            <appender-ref ref="RollingFileAppender" />
        </root>

Yet I am not finding a log file. How would I go about debugging WHY I'm not getting a log file?

Is there a default logger that will always write a log somewhere? Is there a way to turn on logging for the logger itself?

Thanks,
Tom P.


Windows Live™: Keep your life in sync. Check it out.
Ulrich Proeller | 13 Apr 15:45 2009
Picon

LOG4VIEW 3.0 released

After months of development and testing, we are proud to announce the release of LOG4VIEW 3.0. LOG4VIEW is a comfortable and powerful reader for log4net XML- or pattern-formatted log output. LOG4VIEW can read from FileAppenders, UDPAppenders and from a TCPAppender, which is specially developed to work with LOG4VIEW in the LAN oder over the internet.

This new release of LOG4VIEW offers bugfixes, speed improvements and a lot of new features:
- A chart window, which allows visualization of loggers as histogramm, value- or state chart.
- An extended read filter, which allows opening huge log files and reading just the time span or the log levels, you're interested in.
- You can now add comments and bookmarks to the log messages and save and load the enriched log data to and from file.
- New time distance markers give a visual clue on how big is the time span between adjacent messages.
- Minimize Log4View to the system tray and get visual and audible hints, when new messages are coming in.
- Additional German localization.
- Context sensitive help in English and German

You can download LOG4VIEW 3.0 at http://www.log4view.org/download/download.html

View this message in context: LOG4VIEW 3.0 released
Sent from the Log4net - Dev mailing list archive at Nabble.com.
Robert A. McCarter (JIRA | 13 Apr 19:47 2009
Picon

[jira] Commented: (LOG4NET-174) log4net.dll references assemblies that are not part of the .NET 3.5 SP1 client profile


    [
https://issues.apache.org/jira/browse/LOG4NET-174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12698455#action_12698455
] 

Robert A. McCarter commented on LOG4NET-174:
--------------------------------------------

I second this - a logger should not require a reference to System.Web.
Requiring a client (console, WinForms or WPF) application to have a reference to System.Web isn't cool.

> log4net.dll references assemblies that are not part of the .NET 3.5 SP1 client profile
> --------------------------------------------------------------------------------------
>
>                 Key: LOG4NET-174
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-174
>             Project: Log4net
>          Issue Type: Bug
>          Components: Builds
>    Affects Versions: 1.2.10
>         Environment: .Net 3.5 SP1
>            Reporter: Kuno Meyer
>
> .Net 3.5 SP1 / VS 2008 SP1 has a new build feature: the "client-only framework subset" switch in the
projects settings, meaning that the developer can specify that only a limited subset of the .Net
framework is used. This helps in reducing the size of installers that include the .Net framework.
> Unfortunately, log4net.dll (1.2.10) has references to System.Web, which is not part of this
"client-only framework subset". This leads to the following compilation warning:
> <<<
> C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets : warning MSB3253: The
referenced assembly "log4net, Version=1.2.10.0, Culture=neutral,
PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL" has a dependency on "System.Web,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" which is not listed as part of
the "Client" TargetFrameworkSubset. If this dependent reference is required, you may get compilation errors.
> >>>
> My proposal is to split log4net.dll into a new log4net.dll (core+generic appenders) and into a separate
appender DLL (log4net.server.dll) for deployment on servers only.

--

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

Jerry van Leeuwen (JIRA | 14 Apr 03:04 2009
Picon

[jira] Created: (LOG4NET-212) Threading bug in the PatternConverter.cs

Threading bug in the PatternConverter.cs
----------------------------------------

                 Key: LOG4NET-212
                 URL: https://issues.apache.org/jira/browse/LOG4NET-212
             Project: Log4net
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.2.10
         Environment: Windows, .NET 2.0 / 3.5, C#
            Reporter: Jerry van Leeuwen

Every once in a while I get the following exception:

   System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
    Parameter name: length
       at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
       at System.Text.StringBuilder.ToString(Int32 startIndex, Int32 length)
       at log4net.Util.PatternConverter.Format(TextWriter writer, Object state) in
xxx\Log4Net\src\Util\PatternConverter.cs:line 187
       at log4net.Layout.PatternLayout.Format(TextWriter writer, LoggingEvent loggingEvent) in
xxx\Log4Net\src\Layout\PatternLayout.cs:line 1009
       at Nemmco.Common.Initialization.Internal.NemLoggingAppender.Execute(DateTime lastTrigger,
DateTime currentTrigger) in xxxInitialization\Internal\InitializationLogging.cs:line 765
--snip--

From my own investigation it looks like the problem occurs because the shared string buffer (from the
m_formatWriter.GetStringBuilder() call) may end up in a state where its size is adjusted differently on
separate threads, causing one thread to over-estimate the available length.

I wonder if the re-use of a StringWriter / StringBuilder in this scenario actually outweighs the threading
implications? The simplest fix would be to replace use of m_formatWriter with use of a local StringWriter
/ StringBuilder.

--

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

NoreenMac | 21 Apr 12:47 2009
Picon

Log4Net in Multithreaded application


Hi,

I'm using Log4Net in a multithreaded application where each thread has its
own log file. 
My problem is that when two of the threads go to write to their logs at the
same time the output can appear in the wrong log file or sometimes in
mutliple log files.

I have the Log4Net wrapped up in a seperate dll which is instanciated by
each thread.

Has anyone seen anything like this before?

Thanks

--

-- 
View this message in context: http://www.nabble.com/Log4Net-in-Multithreaded-application-tp23153443p23153443.html
Sent from the Log4net - Dev mailing list archive at Nabble.com.

Lewis Moten (JIRA | 23 Apr 19:56 2009
Picon

[jira] Commented: (LOG4NET-88) [PATCH] to AdoNetAppender.cs to support .NET 2.0 connectionStrings configuration section


    [
https://issues.apache.org/jira/browse/LOG4NET-88?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12702032#action_12702032
] 

Lewis Moten commented on LOG4NET-88:
------------------------------------

Ron, you need to activate the options "after" you set the connection string. Otherwise an error occurs (The
ConnectionString property has not been initialized.) Here is a more robust version of the code.

/// <summary>
    /// An appender for Log4Net that uses a database based on the connection string name.
    /// </summary>
    public class Log4NetConnectionStringNameAdoNetAppender : AdoNetAppender
    {
        private static ILog _Log;

        /// <summary>
        /// Gets the log.
        /// </summary>
        /// <value>The log.</value>
        protected static ILog Log
        {
            get
            {
                if (_Log == null)
                    _Log = LogManager.GetLogger(typeof(Log4NetConnectionStringNameAdoNetAppender));
                return _Log;
            }
        }

        private string _ConnectionStringName;

        /// <summary>
        /// Initialize the appender based on the options set
        /// </summary>
        /// <remarks>
        /// 	<para>
        /// This is part of the <see cref="T:log4net.Core.IOptionHandler"/> delayed object
        /// activation scheme. The <see cref="M:log4net.Appender.AdoNetAppender.ActivateOptions"/>
method must
        /// be called on this object after the configuration properties have
        /// been set. Until <see cref="M:log4net.Appender.AdoNetAppender.ActivateOptions"/> is called this
        /// object is in an undefined state and must not be used.
        /// </para>
        /// 	<para>
        /// If any of the configuration properties are modified then
        /// <see cref="M:log4net.Appender.AdoNetAppender.ActivateOptions"/> must be called again.
        /// </para>
        /// </remarks>
        public override void ActivateOptions()
        {
            PopulateConnectionString();
            base.ActivateOptions();
        }

        /// <summary>
        /// Populates the connection string.
        /// </summary>
        private void PopulateConnectionString()
        {
            // if connection string already defined, do nothing
            if (!String.IsNullOrEmpty(ConnectionString)) return;

            // if connection string name is not available, do nothing
            if (String.IsNullOrEmpty(ConnectionStringName)) return;

            // grab connection string settings
            ConnectionStringSettings settings = ConfigurationManager
                .ConnectionStrings[ConnectionStringName];

            // if connection string name was not found in settings
            if (settings == null)
            {
                // log error
                if (Log.IsErrorEnabled)
                    Log.ErrorFormat("Connection String Name not found in Configuration: {0}", 
                        ConnectionStringName);
                // do nothing more
                return;
            }

            // retrieve connection string from the name
            ConnectionString = settings.ConnectionString;
        }

        /// <summary>
        /// Gets or sets the name of the connection string.
        /// </summary>
        /// <value>The name of the connection string.</value>
        public string ConnectionStringName
        {
            get { return _ConnectionStringName; }
            set { _ConnectionStringName = value; }
        }
    }

> [PATCH] to AdoNetAppender.cs to support .NET 2.0 connectionStrings configuration section
> ----------------------------------------------------------------------------------------
>
>                 Key: LOG4NET-88
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-88
>             Project: Log4net
>          Issue Type: Improvement
>          Components: Appenders
>    Affects Versions: 1.2.10
>         Environment: Windows XP .NET 2.0
>            Reporter: Haacked
>            Assignee: Ron Grabowski
>             Fix For: 1.2.11
>
>         Attachments: AdoNetAppenderConnectionStringName.patch
>
>
> This is a patch for [LOG4NET-78] https://issues.apache.org/jira/browse/LOG4NET-78.  This adds a new
"connectionStringName" attribute (and corresponding ConnectionStringName) property to the
AdoNetAppender class.  This is a reference to a connection string within the <ConnectionStrings>
section of an App.config or Web.config file.
> The choice of name "connectionStringName" is consistent with the naming that Microsoft uses in the
various Providers such as SqlMembershipProvider.
> I made sure to put this code in between #if NET_2_0 blocks. However, the patch does not include the required
change to the log4net.csproj file which needs to reference the System.Configuration.dll
(C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.configuration.dll) assembly.  
> This is a .NET 2.0 only assembly so I was unsure how to add a conditional compilation element so that the
project reference would not break log4net for .NET 1.0 and .NET 1.1.  
> If there is a better way to do so, please let me know!

--

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

Xavier Gosset (JIRA | 24 Apr 08:37 2009
Picon

[jira] Created: (LOG4NET-213) Problem while executing 2 windev applications

Problem while executing 2 windev applications
---------------------------------------------

                 Key: LOG4NET-213
                 URL: https://issues.apache.org/jira/browse/LOG4NET-213
             Project: Log4net
          Issue Type: Bug
          Components: Appenders
    Affects Versions: 1.2.10
         Environment: Windows XP
            Reporter: Xavier Gosset

I'm using log4net in .NET for a long time. It's a wonderfull product.
I'm working now on Windev applications.
These applications are using .NET objects without any problems.
So, my idea was to use log4net in these applications.

So, I encapsulated my needs in another .NET assembly:
public class WDLogger
    {
        private StreamWriter _writer;

        private ILog _logger = null;

        public WDLogger()
        {
        }

        public void Load(string loggerName)
        {
	    // For internal debug
            _writer = new System.IO.StreamWriter("c:\\" + loggerName + "_l4n.txt", true);
            _writer.AutoFlush = true;

            System.Console.SetOut(_writer);

            FileInfo fileInfo = new FileInfo("log4net.config");
            log4net.Config.XmlConfigurator.Configure(fileInfo);

            _logger = LogManager.GetLogger(loggerName);
        }

        public void TraceDebug(string message)
        {
            if (_logger != null && _logger.IsDebugEnabled)
                _logger.Debug(message);
        }

        public void TraceInfo(string message)
        {
            if (_logger != null && _logger.IsInfoEnabled)
                _logger.Info(message);
        }

        public void TraceWarn(string message)
        {
            if (_logger != null && _logger.IsWarnEnabled)
                _logger.Warn(message);
        }

        public void TraceError(string message)
        {
            if (_logger != null && _logger.IsErrorEnabled)
                _logger.Error(message);
        }

        public void TraceFatal(string message)
        {
            if (_logger != null && _logger.IsFatalEnabled)
                _logger.Fatal(message);
        }
    }

I have two applications, A and B.
When I start the application A, the traces are written successfully.
When I start the application B, traces of this are not written.

I stop the two applications.

If I start application B, the traces are written successfully.
If I start application A after, traces of this are not written.

I activated log4net internal debug.

And there is only one difference.

Here is the log of application started first:
...
log4net: FileAppender: Opening file for writing
[E:\temp\testlogging\Exe\Logging\NaomiServerLog.txt] append [True]
log4net: XmlHierarchyConfigurator: Created Appender [NaomiServerRollingFileAppender]
log4net: XmlHierarchyConfigurator: Adding appender named [NaomiServerRollingFileAppender] to
logger [NaomiServer].
log4net: XmlHierarchyConfigurator: Hierarchy Threshold []
INFO (2009-04-23 15:36:26,250 - toto) [Info1]
INFO (2009-04-23 15:36:26,265 - toto) [Info2]

Here is the log of the second application:
...
log4net: FileAppender: Opening file for writing
[E:\temp\testlogging\Exe\Logging\NaomiServerLog.txt] append [True]
log4net: XmlHierarchyConfigurator: Created Appender [NaomiServerRollingFileAppender]
log4net: XmlHierarchyConfigurator: Adding appender named [NaomiServerRollingFileAppender] to
logger [NaomiServer].
log4net: XmlHierarchyConfigurator: Hierarchy Threshold []
log4net: FileAppender: Opening file for writing
[E:\temp\testlogging\Exe\Logging\ListenerLog.txt] append [True]
log4net: FileAppender: Opening file for writing
[E:\temp\testlogging\Exe\Logging\ListenerLog.txt] append [True]

Do you have an idea of what it could be?

--

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


Gmane