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

2013-10-22 Thread Mike Podonyi (JIRA)

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

Mike Podonyi commented on LOG4NET-398:
--

Hi Dominik/Stefan

I am getting the same issue but in another context.
I am runing a unit test in mstest when i received this error:wantedt to use 
using MSTest

 SerializationException after setting a LogicalThreadContext property
 

 Key: LOG4NET-398
 URL: https://issues.apache.org/jira/browse/LOG4NET-398
 Project: Log4net
  Issue Type: Bug
  Components: Core
Affects Versions: 1.2.12
 Environment: Visual Studio 2010
Reporter: Thomas Meum

 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:
 1. Create a new ASP.NET Empty Web Application
 2. Add a reference to log4net.dll
 3. Add a new Web Form
 4. Add the following code to Page_Load:
 log4net.LogicalThreadContext.Properties[Test] = 1;
 Uri url = Request.Url;
 5. Hit F5



--
This message was sent by Atlassian JIRA
(v6.1#6144)


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

2013-10-22 Thread Mike Podonyi (JIRA)

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

Mike Podonyi updated LOG4NET-398:
-

Comment: was deleted

(was: Hi Dominik/Stefan

I am getting the same issue but in another context.
I am runing a unit test in mstest when i received this error:wantedt to use 
using MSTest)

 SerializationException after setting a LogicalThreadContext property
 

 Key: LOG4NET-398
 URL: https://issues.apache.org/jira/browse/LOG4NET-398
 Project: Log4net
  Issue Type: Bug
  Components: Core
Affects Versions: 1.2.12
 Environment: Visual Studio 2010
Reporter: Thomas Meum

 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:
 1. Create a new ASP.NET Empty Web Application
 2. Add a reference to log4net.dll
 3. Add a new Web Form
 4. Add the following code to Page_Load:
 log4net.LogicalThreadContext.Properties[Test] = 1;
 Uri url = Request.Url;
 5. Hit F5



--
This message was sent by Atlassian JIRA
(v6.1#6144)


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

2013-10-22 Thread Mike Podonyi (JIRA)

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

Mike Podonyi commented on LOG4NET-398:
--

I am getting the same issue but NOT in an ASP context.
I am having a service which i unit test.

After adding:
LogicalThreadContext.Properties\[SID]=this.Sid;

I am getting the following issue running my unit test:
-- Run test started --
An exception occurred while invoking executor 'executor://mstestadapter/v1': 
Type is not resolved for member 'log4net.Util.PropertiesDictionary,log4net, 
Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
== Run test finished: 0 run (0:00:07.559) ==

Weird is, when i am running the Unit Test in the Debugger (F5) it works just 
fine. 
It only throws when i don't use the Debugger (Ctrl+F5).

I am using Visual Studio 2012 Update 3 and .Net Framework 4.0. So i don't think 
it is a Visual Studio Issue.


 SerializationException after setting a LogicalThreadContext property
 

 Key: LOG4NET-398
 URL: https://issues.apache.org/jira/browse/LOG4NET-398
 Project: Log4net
  Issue Type: Bug
  Components: Core
Affects Versions: 1.2.12
 Environment: Visual Studio 2010
Reporter: Thomas Meum

 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:
 1. Create a new ASP.NET Empty Web Application
 2. Add a reference to log4net.dll
 3. Add a new Web Form
 4. Add the following code to Page_Load:
 log4net.LogicalThreadContext.Properties[Test] = 1;
 Uri url = Request.Url;
 5. Hit F5



--
This message was sent by Atlassian JIRA
(v6.1#6144)


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

2013-10-22 Thread Mike Podonyi (JIRA)

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

Mike Podonyi edited comment on LOG4NET-398 at 10/22/13 2:51 PM:


I am getting the same issue but NOT in an ASP context.
I am having a service which i unit test.

After adding:
LogicalThreadContext.Properties\[SID]=this.Sid;

I am getting the following issue running my unit test:
-- Run test started --
An exception occurred while invoking executor 'executor://mstestadapter/v1': 
Type is not resolved for member 'log4net.Util.PropertiesDictionary,log4net, 
Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
== Run test finished: 0 run (0:00:07.559) ==

I am using Visual Studio 2012 Update 3 and .Net Framework 4.0. So i don't think 
it is a Visual Studio Issue.



was (Author: rudimenter):
I am getting the same issue but NOT in an ASP context.
I am having a service which i unit test.

After adding:
LogicalThreadContext.Properties\[SID]=this.Sid;

I am getting the following issue running my unit test:
-- Run test started --
An exception occurred while invoking executor 'executor://mstestadapter/v1': 
Type is not resolved for member 'log4net.Util.PropertiesDictionary,log4net, 
Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a'.
== Run test finished: 0 run (0:00:07.559) ==

Weird is, when i am running the Unit Test in the Debugger (F5) it works just 
fine. 
It only throws when i don't use the Debugger (Ctrl+F5).

I am using Visual Studio 2012 Update 3 and .Net Framework 4.0. So i don't think 
it is a Visual Studio Issue.


 SerializationException after setting a LogicalThreadContext property
 

 Key: LOG4NET-398
 URL: https://issues.apache.org/jira/browse/LOG4NET-398
 Project: Log4net
  Issue Type: Bug
  Components: Core
Affects Versions: 1.2.12
 Environment: Visual Studio 2010
Reporter: Thomas Meum

 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:
 1. Create a new ASP.NET Empty Web Application
 2. Add a reference to log4net.dll
 3. Add a new Web Form
 4. Add the following code to Page_Load:
 log4net.LogicalThreadContext.Properties[Test] = 1;
 Uri url = Request.Url;
 5. Hit F5



--
This message was sent by Atlassian JIRA
(v6.1#6144)


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

2013-10-22 Thread Dominik Psenner (JIRA)

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

Dominik Psenner commented on LOG4NET-398:
-

Try if installing log4net into the GAC resolves the issue.

 SerializationException after setting a LogicalThreadContext property
 

 Key: LOG4NET-398
 URL: https://issues.apache.org/jira/browse/LOG4NET-398
 Project: Log4net
  Issue Type: Bug
  Components: Core
Affects Versions: 1.2.12
 Environment: Visual Studio 2010
Reporter: Thomas Meum

 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:
 1. Create a new ASP.NET Empty Web Application
 2. Add a reference to log4net.dll
 3. Add a new Web Form
 4. Add the following code to Page_Load:
 log4net.LogicalThreadContext.Properties[Test] = 1;
 Uri url = Request.Url;
 5. Hit F5



--
This message was sent by Atlassian JIRA
(v6.1#6144)


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

2013-10-22 Thread Mike Podonyi (JIRA)

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

Mike Podonyi commented on LOG4NET-398:
--

This fixed the issue on my dev machine.
Please tell me that this is not necessary on the production machine because i 
am not allowed to install anything in the GAC there.

 SerializationException after setting a LogicalThreadContext property
 

 Key: LOG4NET-398
 URL: https://issues.apache.org/jira/browse/LOG4NET-398
 Project: Log4net
  Issue Type: Bug
  Components: Core
Affects Versions: 1.2.12
 Environment: Visual Studio 2010
Reporter: Thomas Meum

 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:
 1. Create a new ASP.NET Empty Web Application
 2. Add a reference to log4net.dll
 3. Add a new Web Form
 4. Add the following code to Page_Load:
 log4net.LogicalThreadContext.Properties[Test] = 1;
 Uri url = Request.Url;
 5. Hit F5



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Created] (LOG4NET-402) SMTP Appender keeps sending me emails

2013-10-22 Thread Darion Mapp (JIRA)
Darion Mapp created LOG4NET-402:
---

 Summary: SMTP Appender keeps sending me emails
 Key: LOG4NET-402
 URL: https://issues.apache.org/jira/browse/LOG4NET-402
 Project: Log4net
  Issue Type: Bug
  Components: Appenders, Examples
Affects Versions: 1.2.11
 Environment: Windows Server 2012
IIS 7
.Net 4 (ASP.Net) c#
Reporter: Darion Mapp
Priority: Minor


I want to receive an email from the system when a log level of ERROR or above 
occurs and i want to get the last 50 events of any level sent including the 
error event. for the life of me I can't figure out hot to stop log4net for 
sending me a email every 5 minutes with the past 50 events none of which is an 
error (errors are rear).

?xml version=1.0 encoding=utf-8 ?
configuration
  configSections
section name=log4net 
type=log4net.Config.Log4netConfigurationSectionHandler, log4net/
  /configSections
  log4net debug=false
appender name=critical-smtp-appender 
type=log4net.Appender.SmtpAppender
  from value=f...@domain.com/
  to value=techsupp...@domain.com/
  smtpHost value=mail.smtpserver.com/
  EnableSsl value=false/
  username value=no_re...@domain.com/
  port value=26/
  authentication value=Basic/
  password value=/
  bufferSize value=50/
  loosy value=true/
  evaluator type=log4net.Core.LevelEvaluator
threshold value=ERROR/
  /evaluator
  priority value=High/
  subject type=log4net.Util.PatternString value =Web Service Incident 
Report: %property{log4net:HostName}/
  layout type=log4net.Layout.PatternLayout
conversionPattern value=Date: %date  Level: %-5level  Logger: 
%logger%newlineMessage: %message%newlineException: 
%exception%newlineStackTrace: %stacktracedetail%newline%newline/
  /layout
/appender
appender name =RollingFileAppender 
type=log4net.Appender.RollingFileAppender
  file value=Logs\ServiceLogs.txt/
  appendToFile value=true/
  rollingStyle value=Composite/
  datePattern value=MMdd/
  maxSizeRollBackups value=30/
  maximumFileSize value=5MB/
  lockingModel type=log4net.Appender.FileAppender+MinimalLock/
  layout type=log4net.Layout.PatternLayout
conversionPattern value =Date: %date  Level: %-5level  Logger: 
%logger%newlineMessage: %message%newlineException: 
%exception%newlineStackTrace: %stacktracedetail%newline%newline/
  /layout
/appender
root
  level value=DEBUG/
  appender-ref ref=RollingFileAppender/
  appender-ref ref=critical-smtp-appender/
/root
  /log4net
/configuration


private static readonly ILog Logger = 
LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

public ComplexWorkWcfService()
{
if (!log4net.LogManager.GetRepository().Configured)
{
var log4netpath = 
System.Web.Hosting.HostingEnvironment.MapPath(~/Log4net.config);
if (log4netpath == null)
log4netpath = 
System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, 
Log4net.config);

log4net.Config.XmlConfigurator.ConfigureAndWatch(new 
System.IO.FileInfo(log4netpath));
Logger.Debug(string.Format(logging configured.));
}
}

log4net version = 1.2.11.0



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Updated] (LOG4NET-402) SMTP Appender keeps sending me emails

2013-10-22 Thread Darion Mapp (JIRA)

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

Darion Mapp updated LOG4NET-402:


Description: 
I want to receive an email from the system when a log level of ERROR or above 
occurs and i want to get the last 50 events of any level sent including the 
error event. for the life of me I can't figure out how to stop log4NET from 
sending me a email every 5 minutes with the past 50 events none of which is an 
error (errors are rear).

?xml version=1.0 encoding=utf-8 ?
configuration
  configSections
section name=log4net 
type=log4net.Config.Log4netConfigurationSectionHandler, log4net/
  /configSections
  log4net debug=false
appender name=critical-smtp-appender 
type=log4net.Appender.SmtpAppender
  from value=f...@domain.com/
  to value=techsupp...@domain.com/
  smtpHost value=mail.smtpserver.com/
  EnableSsl value=false/
  username value=no_re...@domain.com/
  port value=26/
  authentication value=Basic/
  password value=/
  bufferSize value=50/
  loosy value=true/
  evaluator type=log4net.Core.LevelEvaluator
threshold value=ERROR/
  /evaluator
  priority value=High/
  subject type=log4net.Util.PatternString value =Web Service Incident 
Report: %property{log4net:HostName}/
  layout type=log4net.Layout.PatternLayout
conversionPattern value=Date: %date  Level: %-5level  Logger: 
%logger%newlineMessage: %message%newlineException: 
%exception%newlineStackTrace: %stacktracedetail%newline%newline/
  /layout
/appender
appender name =RollingFileAppender 
type=log4net.Appender.RollingFileAppender
  file value=Logs\ServiceLogs.txt/
  appendToFile value=true/
  rollingStyle value=Composite/
  datePattern value=MMdd/
  maxSizeRollBackups value=30/
  maximumFileSize value=5MB/
  lockingModel type=log4net.Appender.FileAppender+MinimalLock/
  layout type=log4net.Layout.PatternLayout
conversionPattern value =Date: %date  Level: %-5level  Logger: 
%logger%newlineMessage: %message%newlineException: 
%exception%newlineStackTrace: %stacktracedetail%newline%newline/
  /layout
/appender
root
  level value=DEBUG/
  appender-ref ref=RollingFileAppender/
  appender-ref ref=critical-smtp-appender/
/root
  /log4net
/configuration


private static readonly ILog Logger = 
LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

public ComplexWorkWcfService()
{
if (!log4net.LogManager.GetRepository().Configured)
{
var log4netpath = 
System.Web.Hosting.HostingEnvironment.MapPath(~/Log4net.config);
if (log4netpath == null)
log4netpath = 
System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, 
Log4net.config);

log4net.Config.XmlConfigurator.ConfigureAndWatch(new 
System.IO.FileInfo(log4netpath));
Logger.Debug(string.Format(logging configured.));
}
}

log4net version = 1.2.11.0

  was:
I want to receive an email from the system when a log level of ERROR or above 
occurs and i want to get the last 50 events of any level sent including the 
error event. for the life of me I can't figure out hot to stop log4net for 
sending me a email every 5 minutes with the past 50 events none of which is an 
error (errors are rear).

?xml version=1.0 encoding=utf-8 ?
configuration
  configSections
section name=log4net 
type=log4net.Config.Log4netConfigurationSectionHandler, log4net/
  /configSections
  log4net debug=false
appender name=critical-smtp-appender 
type=log4net.Appender.SmtpAppender
  from value=f...@domain.com/
  to value=techsupp...@domain.com/
  smtpHost value=mail.smtpserver.com/
  EnableSsl value=false/
  username value=no_re...@domain.com/
  port value=26/
  authentication value=Basic/
  password value=/
  bufferSize value=50/
  loosy value=true/
  evaluator type=log4net.Core.LevelEvaluator
threshold value=ERROR/
  /evaluator
  priority value=High/
  subject type=log4net.Util.PatternString value =Web Service Incident 
Report: %property{log4net:HostName}/
  layout type=log4net.Layout.PatternLayout
conversionPattern value=Date: %date  Level: %-5level  Logger: 
%logger%newlineMessage: %message%newlineException: 
%exception%newlineStackTrace: %stacktracedetail%newline%newline/
  /layout
/appender
appender name =RollingFileAppender 
type=log4net.Appender.RollingFileAppender
  file value=Logs\ServiceLogs.txt/
  appendToFile value=true/
  rollingStyle value=Composite/
  datePattern value=MMdd/
  maxSizeRollBackups value=30/
  maximumFileSize value=5MB/
  lockingModel type=log4net.Appender.FileAppender+MinimalLock/
  layout 

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

2013-10-22 Thread Dominik Psenner (JIRA)

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

Dominik Psenner commented on LOG4NET-398:
-

Looks like some environments (i.e. Visual Studio 2010) are not smart enough to 
load referenced local assemblies. Placing these local assemblies in the right 
spot (nearby the executable), installing it into the GAC or maybe working 
around this with the 
[AppDomain.AssemblyResolve|http://msdn.microsoft.com/en-us/library/system.appdomain.assemblyresolve.aspx]
 should solve the issue.

 SerializationException after setting a LogicalThreadContext property
 

 Key: LOG4NET-398
 URL: https://issues.apache.org/jira/browse/LOG4NET-398
 Project: Log4net
  Issue Type: Bug
  Components: Core
Affects Versions: 1.2.12
 Environment: Visual Studio 2010
Reporter: Thomas Meum

 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:
 1. Create a new ASP.NET Empty Web Application
 2. Add a reference to log4net.dll
 3. Add a new Web Form
 4. Add the following code to Page_Load:
 log4net.LogicalThreadContext.Properties[Test] = 1;
 Uri url = Request.Url;
 5. Hit F5



--
This message was sent by Atlassian JIRA
(v6.1#6144)


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

2013-10-22 Thread Dominik Psenner (JIRA)

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

Dominik Psenner edited comment on LOG4NET-398 at 10/22/13 5:05 PM:
---

Looks like some environments (i.e. Visual Studio 2010) are not smart enough to 
load referenced local assemblies. Placing these local assemblies in the right 
spot (nearby the executable), installing them into the GAC or maybe even 
working around this with the 
[AppDomain.AssemblyResolve|http://msdn.microsoft.com/en-us/library/system.appdomain.assemblyresolve.aspx]
 event should work around this issue.


was (Author: nachbarslumpi):
Looks like some environments (i.e. Visual Studio 2010) are not smart enough to 
load referenced local assemblies. Placing these local assemblies in the right 
spot (nearby the executable), installing them into the GAC or maybe working 
around this with the 
[AppDomain.AssemblyResolve|http://msdn.microsoft.com/en-us/library/system.appdomain.assemblyresolve.aspx]
 should solve the issue.

 SerializationException after setting a LogicalThreadContext property
 

 Key: LOG4NET-398
 URL: https://issues.apache.org/jira/browse/LOG4NET-398
 Project: Log4net
  Issue Type: Bug
  Components: Core
Affects Versions: 1.2.12
 Environment: Visual Studio 2010
Reporter: Thomas Meum

 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:
 1. Create a new ASP.NET Empty Web Application
 2. Add a reference to log4net.dll
 3. Add a new Web Form
 4. Add the following code to Page_Load:
 log4net.LogicalThreadContext.Properties[Test] = 1;
 Uri url = Request.Url;
 5. Hit F5



--
This message was sent by Atlassian JIRA
(v6.1#6144)


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

2013-10-22 Thread Dominik Psenner (JIRA)

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

Dominik Psenner edited comment on LOG4NET-398 at 10/22/13 5:04 PM:
---

Looks like some environments (i.e. Visual Studio 2010) are not smart enough to 
load referenced local assemblies. Placing these local assemblies in the right 
spot (nearby the executable), installing them into the GAC or maybe working 
around this with the 
[AppDomain.AssemblyResolve|http://msdn.microsoft.com/en-us/library/system.appdomain.assemblyresolve.aspx]
 should solve the issue.


was (Author: nachbarslumpi):
Looks like some environments (i.e. Visual Studio 2010) are not smart enough to 
load referenced local assemblies. Placing these local assemblies in the right 
spot (nearby the executable), installing it into the GAC or maybe working 
around this with the 
[AppDomain.AssemblyResolve|http://msdn.microsoft.com/en-us/library/system.appdomain.assemblyresolve.aspx]
 should solve the issue.

 SerializationException after setting a LogicalThreadContext property
 

 Key: LOG4NET-398
 URL: https://issues.apache.org/jira/browse/LOG4NET-398
 Project: Log4net
  Issue Type: Bug
  Components: Core
Affects Versions: 1.2.12
 Environment: Visual Studio 2010
Reporter: Thomas Meum

 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:
 1. Create a new ASP.NET Empty Web Application
 2. Add a reference to log4net.dll
 3. Add a new Web Form
 4. Add the following code to Page_Load:
 log4net.LogicalThreadContext.Properties[Test] = 1;
 Uri url = Request.Url;
 5. Hit F5



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Commented] (LOG4NET-402) SMTP Appender keeps sending me emails

2013-10-22 Thread Dominik Psenner (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13802019#comment-13802019
 ] 

Dominik Psenner commented on LOG4NET-402:
-

Maybe you can solve this by filtering the events in the appender:

http://logging.apache.org/log4net/release/manual/configuration.html#filters

Please close the issue if that's the solution to your problem.

 SMTP Appender keeps sending me emails
 -

 Key: LOG4NET-402
 URL: https://issues.apache.org/jira/browse/LOG4NET-402
 Project: Log4net
  Issue Type: Bug
  Components: Appenders, Examples
Affects Versions: 1.2.11
 Environment: Windows Server 2012
 IIS 7
 .Net 4 (ASP.Net) c#
Reporter: Darion Mapp
Priority: Minor

 I want to receive an email from the system when a log level of ERROR or above 
 occurs and i want to get the last 50 events of any level sent including the 
 error event. for the life of me I can't figure out how to stop log4NET from 
 sending me a email every 5 minutes with the past 50 events none of which is 
 an error (errors are rear).
 ?xml version=1.0 encoding=utf-8 ?
 configuration
   configSections
 section name=log4net 
 type=log4net.Config.Log4netConfigurationSectionHandler, log4net/
   /configSections
   log4net debug=false
   appender name=critical-smtp-appender 
 type=log4net.Appender.SmtpAppender
   from value=f...@domain.com/
   to value=techsupp...@domain.com/
   smtpHost value=mail.smtpserver.com/
 EnableSsl value=false/
   username value=no_re...@domain.com/
   port value=26/
 authentication value=Basic/
   password value=/
 bufferSize value=50/
 loosy value=true/
 evaluator type=log4net.Core.LevelEvaluator
 threshold value=ERROR/
   /evaluator
   priority value=High/
   subject type=log4net.Util.PatternString value =Web Service Incident 
 Report: %property{log4net:HostName}/
   layout type=log4net.Layout.PatternLayout
 conversionPattern value=Date: %date  Level: %-5level  Logger: 
 %logger%newlineMessage: %message%newlineException: 
 %exception%newlineStackTrace: %stacktracedetail%newline%newline/
   /layout
 /appender
 appender name =RollingFileAppender 
 type=log4net.Appender.RollingFileAppender
   file value=Logs\ServiceLogs.txt/
   appendToFile value=true/
   rollingStyle value=Composite/
   datePattern value=MMdd/
   maxSizeRollBackups value=30/
   maximumFileSize value=5MB/
   lockingModel type=log4net.Appender.FileAppender+MinimalLock/
   layout type=log4net.Layout.PatternLayout
 conversionPattern value =Date: %date  Level: %-5level  Logger: 
 %logger%newlineMessage: %message%newlineException: 
 %exception%newlineStackTrace: %stacktracedetail%newline%newline/
   /layout
 /appender
 root
   level value=DEBUG/
   appender-ref ref=RollingFileAppender/
   appender-ref ref=critical-smtp-appender/
 /root
   /log4net
 /configuration
 private static readonly ILog Logger = 
 LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
 public ComplexWorkWcfService()
 {
   if (!log4net.LogManager.GetRepository().Configured)
   {
   var log4netpath = 
 System.Web.Hosting.HostingEnvironment.MapPath(~/Log4net.config);
   if (log4netpath == null)
   log4netpath = 
 System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, 
 Log4net.config);
   log4net.Config.XmlConfigurator.ConfigureAndWatch(new 
 System.IO.FileInfo(log4netpath));
   Logger.Debug(string.Format(logging configured.));
   }
 }
 log4net version = 1.2.11.0



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Commented] (LOG4NET-402) SMTP Appender keeps sending me emails

2013-10-22 Thread Darion Mapp (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13802034#comment-13802034
 ] 

Darion Mapp commented on LOG4NET-402:
-

What I would expect the filter to do is limit the entries being logged. This is 
NOT what I want. I want to see ALL the levels but ONLY when an ERROR occurs. So 
it's like 5 days of no emails followed by one email with the last 50 events, 
assuming an ERROR occurs on the 5th day.

 SMTP Appender keeps sending me emails
 -

 Key: LOG4NET-402
 URL: https://issues.apache.org/jira/browse/LOG4NET-402
 Project: Log4net
  Issue Type: Bug
  Components: Appenders, Examples
Affects Versions: 1.2.11
 Environment: Windows Server 2012
 IIS 7
 .Net 4 (ASP.Net) c#
Reporter: Darion Mapp
Priority: Minor

 I want to receive an email from the system when a log level of ERROR or above 
 occurs and i want to get the last 50 events of any level sent including the 
 error event. for the life of me I can't figure out how to stop log4NET from 
 sending me a email every 5 minutes with the past 50 events none of which is 
 an error (errors are rear).
 ?xml version=1.0 encoding=utf-8 ?
 configuration
   configSections
 section name=log4net 
 type=log4net.Config.Log4netConfigurationSectionHandler, log4net/
   /configSections
   log4net debug=false
   appender name=critical-smtp-appender 
 type=log4net.Appender.SmtpAppender
   from value=f...@domain.com/
   to value=techsupp...@domain.com/
   smtpHost value=mail.smtpserver.com/
 EnableSsl value=false/
   username value=no_re...@domain.com/
   port value=26/
 authentication value=Basic/
   password value=/
 bufferSize value=50/
 loosy value=true/
 evaluator type=log4net.Core.LevelEvaluator
 threshold value=ERROR/
   /evaluator
   priority value=High/
   subject type=log4net.Util.PatternString value =Web Service Incident 
 Report: %property{log4net:HostName}/
   layout type=log4net.Layout.PatternLayout
 conversionPattern value=Date: %date  Level: %-5level  Logger: 
 %logger%newlineMessage: %message%newlineException: 
 %exception%newlineStackTrace: %stacktracedetail%newline%newline/
   /layout
 /appender
 appender name =RollingFileAppender 
 type=log4net.Appender.RollingFileAppender
   file value=Logs\ServiceLogs.txt/
   appendToFile value=true/
   rollingStyle value=Composite/
   datePattern value=MMdd/
   maxSizeRollBackups value=30/
   maximumFileSize value=5MB/
   lockingModel type=log4net.Appender.FileAppender+MinimalLock/
   layout type=log4net.Layout.PatternLayout
 conversionPattern value =Date: %date  Level: %-5level  Logger: 
 %logger%newlineMessage: %message%newlineException: 
 %exception%newlineStackTrace: %stacktracedetail%newline%newline/
   /layout
 /appender
 root
   level value=DEBUG/
   appender-ref ref=RollingFileAppender/
   appender-ref ref=critical-smtp-appender/
 /root
   /log4net
 /configuration
 private static readonly ILog Logger = 
 LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
 public ComplexWorkWcfService()
 {
   if (!log4net.LogManager.GetRepository().Configured)
   {
   var log4netpath = 
 System.Web.Hosting.HostingEnvironment.MapPath(~/Log4net.config);
   if (log4netpath == null)
   log4netpath = 
 System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, 
 Log4net.config);
   log4net.Config.XmlConfigurator.ConfigureAndWatch(new 
 System.IO.FileInfo(log4netpath));
   Logger.Debug(string.Format(logging configured.));
   }
 }
 log4net version = 1.2.11.0



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Commented] (LOG4NET-402) SMTP Appender keeps sending me emails

2013-10-22 Thread Darion Mapp (JIRA)

[ 
https://issues.apache.org/jira/browse/LOG4NET-402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13802265#comment-13802265
 ] 

Darion Mapp commented on LOG4NET-402:
-

Could the following code in the class de-constructor (see below) be causing the 
emails to be sent? In the setup stated above would calling flush on the smtp 
appender trigger the email or would it treat this as an internal log full event 
and just discard the unwanted DEBUG and INFO entries given that the evaluator 
was not triggered? 

ILog log = 
LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
var logger = log.Logger as Logger;
if (logger != null)
{
foreach (IAppender appender in logger.Appenders)
{
var buffered = appender as BufferingAppenderSkeleton;
if (buffered != null)
{
buffered.Flush(); //Can this be done with an smtp 
appender and not get a email. This is needed for the other file appenders. 
}

}
}

 SMTP Appender keeps sending me emails
 -

 Key: LOG4NET-402
 URL: https://issues.apache.org/jira/browse/LOG4NET-402
 Project: Log4net
  Issue Type: Bug
  Components: Appenders, Examples
Affects Versions: 1.2.11
 Environment: Windows Server 2012
 IIS 7
 .Net 4 (ASP.Net) c#
Reporter: Darion Mapp
Priority: Minor

 I want to receive an email from the system when a log level of ERROR or above 
 occurs and i want to get the last 50 events of any level sent including the 
 error event. for the life of me I can't figure out how to stop log4NET from 
 sending me a email every 5 minutes with the past 50 events none of which is 
 an error (errors are rear).
 ?xml version=1.0 encoding=utf-8 ?
 configuration
   configSections
 section name=log4net 
 type=log4net.Config.Log4netConfigurationSectionHandler, log4net/
   /configSections
   log4net debug=false
   appender name=critical-smtp-appender 
 type=log4net.Appender.SmtpAppender
   from value=f...@domain.com/
   to value=techsupp...@domain.com/
   smtpHost value=mail.smtpserver.com/
 EnableSsl value=false/
   username value=no_re...@domain.com/
   port value=26/
 authentication value=Basic/
   password value=/
 bufferSize value=50/
 loosy value=true/
 evaluator type=log4net.Core.LevelEvaluator
 threshold value=ERROR/
   /evaluator
   priority value=High/
   subject type=log4net.Util.PatternString value =Web Service Incident 
 Report: %property{log4net:HostName}/
   layout type=log4net.Layout.PatternLayout
 conversionPattern value=Date: %date  Level: %-5level  Logger: 
 %logger%newlineMessage: %message%newlineException: 
 %exception%newlineStackTrace: %stacktracedetail%newline%newline/
   /layout
 /appender
 appender name =RollingFileAppender 
 type=log4net.Appender.RollingFileAppender
   file value=Logs\ServiceLogs.txt/
   appendToFile value=true/
   rollingStyle value=Composite/
   datePattern value=MMdd/
   maxSizeRollBackups value=30/
   maximumFileSize value=5MB/
   lockingModel type=log4net.Appender.FileAppender+MinimalLock/
   layout type=log4net.Layout.PatternLayout
 conversionPattern value =Date: %date  Level: %-5level  Logger: 
 %logger%newlineMessage: %message%newlineException: 
 %exception%newlineStackTrace: %stacktracedetail%newline%newline/
   /layout
 /appender
 root
   level value=DEBUG/
   appender-ref ref=RollingFileAppender/
   appender-ref ref=critical-smtp-appender/
 /root
   /log4net
 /configuration
 private static readonly ILog Logger = 
 LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
 public ComplexWorkWcfService()
 {
   if (!log4net.LogManager.GetRepository().Configured)
   {
   var log4netpath = 
 System.Web.Hosting.HostingEnvironment.MapPath(~/Log4net.config);
   if (log4netpath == null)
   log4netpath = 
 System.IO.Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory, 
 Log4net.config);
   log4net.Config.XmlConfigurator.ConfigureAndWatch(new 
 System.IO.FileInfo(log4netpath));
   Logger.Debug(string.Format(logging configured.));
   }
 }
 log4net version = 1.2.11.0



--
This message was sent by Atlassian JIRA
(v6.1#6144)