Dominik Psenner (JIRA | 29 Jun 08:53 2015
Picon

[jira] [Commented] (LOG4NET-398) SerializationException after setting a LogicalThreadContext property


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

Dominik Psenner commented on LOG4NET-398:
-----------------------------------------

Apologies, [~Nellemandela]. I'm rather busy with debugging a baby. :-) It would be nice if someone else
could look into this as I won't get a chance to do it anytime soon.

> SerializationException after setting a LogicalThreadContext property
> --------------------------------------------------------------------
>
>                 Key: LOG4NET-398
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-398
>             Project: Log4net
>          Issue Type: Task
>          Components: Core
>    Affects Versions: 1.2.12
>         Environment: Visual Studio 2010
>            Reporter: Thomas Meum
>            Priority: Minor
>              Labels: triaged
>         Attachments: log4net.zip
>
>
> I have found that accessing Page.Request.Url after setting a LogicalThreadContext property causes a
SerializationException with the following message: Type is not resolved for member
'log4net.Util.PropertiesDictionary,log4net, Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
(Continue reading)

Picon

[jira] [Commented] (LOG4NET-398) SerializationException after setting a LogicalThreadContext property


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

Lars Nellemann Nielsen commented on LOG4NET-398:
------------------------------------------------

[~nachbarslumpi] Have you had a chance to test the attached solution ?

> SerializationException after setting a LogicalThreadContext property
> --------------------------------------------------------------------
>
>                 Key: LOG4NET-398
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-398
>             Project: Log4net
>          Issue Type: Task
>          Components: Core
>    Affects Versions: 1.2.12
>         Environment: Visual Studio 2010
>            Reporter: Thomas Meum
>            Priority: Minor
>              Labels: triaged
>         Attachments: log4net.zip
>
>
> I have found that accessing Page.Request.Url after setting a LogicalThreadContext property causes a
SerializationException with the following message: Type is not resolved for member
'log4net.Util.PropertiesDictionary,log4net, Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
> I have been able to reproduce the problem on two different machines with the following steps:
(Continue reading)

MichalisN | 27 Jun 21:46 2015
Picon

[GitHub] log4net pull request: Fixed RandomStringPatternConverter instance ...

GitHub user MichalisN opened a pull request:

    https://github.com/apache/log4net/pull/15

    Fixed RandomStringPatternConverter instance creation

    Unit test was failing because exception was thrown on instance creation

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/MichalisN/log4net FixUnitTests

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/log4net/pull/15.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #15

----
commit 9144d4e67fe4308d5ebcdfd3e98a3dc503e223ed
Author: Michalis Nicolaides <michael1337 <at> hotmail.com>
Date:   2015-06-27T19:38:11Z

    Fixed RandomStringPatternConverter instance creation

----

(Continue reading)

Andrei Faber (JIRA | 26 Jun 10:13 2015
Picon

[jira] [Created] (LOG4NET-466) "LockRecursionException: A read lock may not be acquired with the write lock held in this mode." exception

Andrei Faber created LOG4NET-466:
------------------------------------

             Summary: "LockRecursionException: A read lock may not be acquired with the write lock held in this mode." exception
                 Key: LOG4NET-466
                 URL: https://issues.apache.org/jira/browse/LOG4NET-466
             Project: Log4net
          Issue Type: Bug
          Components: Core
    Affects Versions: 1.2.13
         Environment: Windows 7 x64 / .NET 4.5.2
            Reporter: Andrei Faber

I'm getting this exception when trying to call ILog.Error() method (the logger used is RollingFileAppender):

log4net:ERROR Exception while logging
System.Threading.LockRecursionException: A read lock may not be acquired with the write lock held in
this mode.
   at System.Threading.ReaderWriterLockSlim.TryEnterReadLockCore(TimeoutTracker timeout)
   at System.Threading.ReaderWriterLockSlim.TryEnterReadLock(TimeoutTracker timeout)
   at System.Threading.ReaderWriterLockSlim.EnterReadLock()
   at log4net.Util.ReaderWriterLock.AcquireReaderLock()
   at log4net.Repository.Hierarchy.Logger.CallAppenders(LoggingEvent loggingEvent)
   at log4net.Repository.Hierarchy.Logger.ForcedLog(Type callerStackBoundaryDeclaringType, Level
level, Object message, Exception exception)
   at log4net.Repository.Hierarchy.Logger.Log(Type callerStackBoundaryDeclaringType, Level level,
Object message, Exception exception)

Any ideas why it might be happening?

(Continue reading)

Michel Emond (JIRA | 25 Jun 16:31 2015
Picon

[jira] [Comment Edited] (LOG4NET-465) Rolling log files get overwritten when IIS is restarted


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

Michel Emond edited comment on LOG4NET-465 at 6/25/15 2:30 PM:
---------------------------------------------------------------

I had these lines removed for the following reason: In DetermineCurSizeRollBackups(), fullPath is fixed
with the date pattern (by the lines added in my fix) and then fed to GetExistingFiles(). The result of
GetExistingFiles() is then passed to InitializeRollBackups() and then to InitializeFromOneFile()
(i.e. where the lines are removed). At this point, every file name being handled already matches the date
pattern so there's no need for an additional check.

Sure, no problem, that's what code reviews are for!

was (Author: memond):
I had these lines removed for the following reason: In DetermineCurSizeRollBackups(), fullPath is fixed
with the date pattern and then fed to GetExistingFiles(). The result of GetExistingFiles() is then
passed to InitializeRollBackups() and then to InitializeFromOneFile() (i.e. where the lines are
removed). At this point, every file name being handled already matches the date pattern so there's no need
for an additional check.

Sure, no problem, that's what code reviews are for!

> Rolling log files get overwritten when IIS is restarted
> -------------------------------------------------------
>
>                 Key: LOG4NET-465
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-465
(Continue reading)

Michel Emond (JIRA | 25 Jun 16:27 2015
Picon

[jira] [Commented] (LOG4NET-465) Rolling log files get overwritten when IIS is restarted


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

Michel Emond commented on LOG4NET-465:
--------------------------------------

I had these lines removed for the following reason: In DetermineCurSizeRollBackups(), fullPath is fixed
with the date pattern and then fed to GetExistingFiles(). The result of GetExistingFiles() is then
passed to InitializeRollBackups() and then to InitializeFromOneFile() (i.e. where the lines are
removed). At this point, every file name being handled already matches the date pattern so there's no need
for an additional check.

Sure, no problem, that's what code reviews are for!

> Rolling log files get overwritten when IIS is restarted
> -------------------------------------------------------
>
>                 Key: LOG4NET-465
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-465
>             Project: Log4net
>          Issue Type: Bug
>          Components: Appenders
>    Affects Versions: 1.2.13
>         Environment: asp.net 4.0
>            Reporter: Michel Emond
>         Attachments: RollingFileAppender.diff, config.xml
>
>
(Continue reading)

Picon

[jira] [Comment Edited] (LOG4NET-398) SerializationException after setting a LogicalThreadContext property


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

Lars Nellemann Nielsen edited comment on LOG4NET-398 at 6/24/15 12:38 PM:
--------------------------------------------------------------------------

I'm not certain, frankly i'm a bit amazed that this is even an issue

Ive attached a simple project, so you can reproduce

the executing console application has no references to log4net, it doesn't even have any references to the
other console applications as they are being loaded and executed with
[AppDomain.ExecuteAssembly(String)|https://msdn.microsoft.com/en-us/library/sxx9f4c2%28v=vs.110%29.aspx]
i.e only by their path

and as you can see in the solution, no logging is being done

Placing log4net.dll in the root of the executing console application is just the same as placing it in GAC

was (Author: nellemandela):
I'm not certain, frankly i'm a bit amazed that this is even an issue

Ive attached a simple project, so you can reproduce

the executing console application has no references to log4net, it doesn't even have any references to the
other console applications as they are being loaded and executed with
[AppDomain.ExecuteAssembly(String)|https://msdn.microsoft.com/en-us/library/sxx9f4c2%28v=vs.110%29.aspx]
i.e only by their path
(Continue reading)

Picon

[jira] [Issue Comment Deleted] (LOG4NET-398) SerializationException after setting a LogicalThreadContext property


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

Lars Nellemann Nielsen updated LOG4NET-398:
-------------------------------------------
    Comment: was deleted

(was: Solution to reproduce)

> SerializationException after setting a LogicalThreadContext property
> --------------------------------------------------------------------
>
>                 Key: LOG4NET-398
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-398
>             Project: Log4net
>          Issue Type: Task
>          Components: Core
>    Affects Versions: 1.2.12
>         Environment: Visual Studio 2010
>            Reporter: Thomas Meum
>            Priority: Minor
>              Labels: triaged
>         Attachments: log4net.zip
>
>
> I have found that accessing Page.Request.Url after setting a LogicalThreadContext property causes a
SerializationException with the following message: Type is not resolved for member
'log4net.Util.PropertiesDictionary,log4net, Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
> I have been able to reproduce the problem on two different machines with the following steps:
(Continue reading)

Picon

[jira] [Updated] (LOG4NET-398) SerializationException after setting a LogicalThreadContext property


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

Lars Nellemann Nielsen updated LOG4NET-398:
-------------------------------------------
    Attachment: log4net.zip

Solution to reproduce

> SerializationException after setting a LogicalThreadContext property
> --------------------------------------------------------------------
>
>                 Key: LOG4NET-398
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-398
>             Project: Log4net
>          Issue Type: Task
>          Components: Core
>    Affects Versions: 1.2.12
>         Environment: Visual Studio 2010
>            Reporter: Thomas Meum
>            Priority: Minor
>              Labels: triaged
>         Attachments: log4net.zip
>
>
> I have found that accessing Page.Request.Url after setting a LogicalThreadContext property causes a
SerializationException with the following message: Type is not resolved for member
'log4net.Util.PropertiesDictionary,log4net, Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
> I have been able to reproduce the problem on two different machines with the following steps:
(Continue reading)

Picon

[jira] [Commented] (LOG4NET-398) SerializationException after setting a LogicalThreadContext property


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

Lars Nellemann Nielsen commented on LOG4NET-398:
------------------------------------------------

I'm not certain, frankly i'm a bit amazed that this is even an issue

Ive attached a simple project, so you can reproduce

the executing console application has no references to log4net, it doesn't even have any references to the
other console applications as they are being loaded and executed with
[AppDomain.ExecuteAssembly(String)|https://msdn.microsoft.com/en-us/library/sxx9f4c2%28v=vs.110%29.aspx]
i.e only by their path

Placing log4net.dll in the root of the executing console application is just the same as placing it in GAC

> SerializationException after setting a LogicalThreadContext property
> --------------------------------------------------------------------
>
>                 Key: LOG4NET-398
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-398
>             Project: Log4net
>          Issue Type: Task
>          Components: Core
>    Affects Versions: 1.2.12
>         Environment: Visual Studio 2010
>            Reporter: Thomas Meum
(Continue reading)

Dominik Psenner (JIRA | 24 Jun 12:03 2015
Picon

[jira] [Commented] (LOG4NET-398) SerializationException after setting a LogicalThreadContext property


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

Dominik Psenner commented on LOG4NET-398:
-----------------------------------------

You are right, AppDomains shouldn't be able to share information unless the objects are
serialized/deserialized. But to me it sounds strange that a dictionary tries to cross into another
AppDomain. At first sight, this shouldn't happen at all. Can you work out why this happens?

> SerializationException after setting a LogicalThreadContext property
> --------------------------------------------------------------------
>
>                 Key: LOG4NET-398
>                 URL: https://issues.apache.org/jira/browse/LOG4NET-398
>             Project: Log4net
>          Issue Type: Task
>          Components: Core
>    Affects Versions: 1.2.12
>         Environment: Visual Studio 2010
>            Reporter: Thomas Meum
>            Priority: Minor
>              Labels: triaged
>
> I have found that accessing Page.Request.Url after setting a LogicalThreadContext property causes a
SerializationException with the following message: Type is not resolved for member
'log4net.Util.PropertiesDictionary,log4net, Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
> I have been able to reproduce the problem on two different machines with the following steps:
(Continue reading)


Gmane