RE: Welcome Dominik Psenner as new Committer

2012-06-08 Thread Dominik Psenner
Dear log4net community,

it is my pleasure to inform you, Dominik has been elected as a new
committer to the project.  He's been active around here for quite some
time and will now be able to work on the code base directly.  I'm sure
the project is going to benefit a lot from him.

Welcome Dominik

Hi community,

thanks Stefan for the warm welcome! I'm glad to have been chosen and am sure
that our joint efforts will bear great benefits to the project.

Cheers,
Dominik



RE: fileAppender.ActivateOptions generates NullReferenceException

2012-06-22 Thread Dominik Psenner
So I'm calling fileAppender.ActivateOptions to change the log file name 
it
occasional generates a NullReferenceException, but the catch is that it
only
does it occasionally.  It usually works.

The posts I've all read involve issues that would lead
fileAppender.ActivateOptions to fail all the time, not just at seemingly
random moments.  Any thoughts on this?

Hi Chris,

can you provide us a stacktrace to pinpoint the problem?

Cheers,
D.



RE: Lossy logging on a per user basis for a high traffic website

2012-08-07 Thread Dominik Psenner
Hi Joe,

 

I would recommend You to implement a filter that matches your requirements
by implementing the IFilter interface or - even better - by subclassing
FilterSkeleton.

 

Cheers,

Dominik

 

  _  

From: Joe Udwin [mailto:joe.ud...@questionmark.co.uk] 
Sent: Tuesday, August 07, 2012 12:44 PM
To: 'log4net-user@logging.apache.org'
Subject: Lossy logging on a per user basis for a high traffic website

 

I'm looking to setup lossy logging (on a high traffic website) on a per user
(or per request) basis.

E.g The application logs nothing until an error occurs when all logs are
then written to a file (or db).

 

I have been playing around with the BufferingForwardingAppender but it looks
like it buffers all logs sent to it (not per thread or per request), so on a
high traffic site this could be a combination of multiple user's log
messages. On a busy site other users log messages could completely push the
useful logs out of the buffer.

 

Has anyone done anything similar?

Are people using lossy logging on a high volume website?

Would you recommend this approach?

Any ideas how I might achieve this? 

 

Thank you for your help in advance!



RE: Lossy logging on a per user basis for a high traffic website

2012-08-08 Thread Dominik Psenner
Hi Joe,

 I would need to buffer huge volumes of other users messages in order to be

 confident that the user who is in an exceptional state still had all their

 messages in the buffer.

My approach would be as simple as this pseudo-code:

public abstract class YourFilter : FilterSkeleton {
   private Liststring usersInError = new Liststring();

   public override bool Decide(LoggingEvent loggingEvent) {
  // check if the logging event satisfies a error condition
  if(IsConditionMet(loggingEvent)) {
 usersInError.Add(GetGroup(loggingEvent));
  }
  // make sure the event is logged
  if(usersInError.Contains(GetGroup(loggingEvent))) {
 if(IsCancelConditionmet(loggingEvent)) {
   usersInError.Remove(GetGroup(loggingEvent));
 }
 return true;
  }
  return false;
   }

   private abstract bool IsConditionMet(LoggingEvent loggingEvent);
   private abstract bool IsCancelConditionMet(LoggingEvent loggingEvent);
   private abstract string GetGroup(LoggingEvent loggingEvent);
}

This discards messages until a specific condition is met and then starts
logging all future events for the same group of LoggingEvents until a
specific cancel condition is met.

The grouping function could return the username and thus effectively log
only messages for a user in exceptional state.

 Instead, I think I need some sort of buffer per request that the appender 
 uses when the ERROR condition is satisfied, however I am unsure if 
 log4net's architecture would allow me to do this?

Log4net dispatches logging events to an appender that claims to be in charge
and it is left to the appender how the logging event is treated. The most
common operations are to:

  * serialize (to a file, to a database, ..)
  * discard
  * buffer (i.e. to minimize overheads like file open/close/lock operations)
  * relay to other appenders

Just to make sure I understood Your situation, please tell me. Are you:

 1] Trying to log future events after a specific event has been detected?
 2] Trying to log past events that have already happened before a specific
event has been detected?

Cheers,
Dominik



RE: log4net RollingLogFileAppender: is this possible to set limit for TOTAL size of all log files?

2012-09-24 Thread Dominik Psenner
Hi Kelly,

Configured like this the total maximum size of all log files should be
around 5MB * 10, which is somewhat like 50MB. Scaling either the size of a
single logfile (maximumFileSize) or the number of logfiles
(maxSizeRollBackups) by 2 should bring you to your 100MB, doesn't it?

Cheers

-Original Message-
From: KellyLynch [mailto:g...@tut.by]
Sent: Monday, September 24, 2012 11:16 AM
To: log4net-user@logging.apache.org
Subject: log4net RollingLogFileAppender: is this possible to set limit for
TOTAL size of all log files?


In my .NET application I use log4net with the following configuration:

configuration
configSections
section name=log4net
   type=log4net.Config.Log4NetConfigurationSectionHandler,
log4net
/
/configSections
log4net
appender name=RollingLogFileAppender
type=log4net.Appender.RollingFileAppender
  lockingModel type=log4net.Appender.FileAppender+MinimalLock/
  file value=logs\ /
  datePattern value=-MM-dd.lo\g/
  staticLogFileName value=false /
  appendToFile value=true /
  countDirection value=1/
  rollingStyle value=Composite /
  maxSizeRollBackups value=10 /
  maximumFileSize value=5MB /
  layout type=log4net.Layout.PatternLayout
conversionPattern value=%date [%thread] %-5level %logger
[%property{NDC}] - %message%newline /
  /layout
/appender

root
level value=ALL /
appender-ref ref=RollingLogFileAppender /
/root
/log4net
/configuration



It produces a set of log files like the following:
2012-09-24.log.0
2012-09-24.log.1
...
2012-09-24.log.10

This is ALMOST what I want. The final thing I want is: to set a limit by
total size of ALL the log files in the given location (folder). In other
words - if total size of all the log files in the given location exceeds,
say, 100MB, the oldest file will be removed; does not matter does the file
belong to current day or to some day in the past. To the moment the .config
above provides a different logic: limit by size of all the log files in the
current GROUP (in my case the 'group' is 'current day').

Can I have RollingLogFileAppender working the way I want?

--
View this message in context: http://old.nabble.com/log4net-
RollingLogFileAppender%3A-is-this-possible-to-set-limit-for-TOTAL-size-of-
all-log-files--tp34471537p34471537.html
Sent from the Log4net - Users mailing list archive at Nabble.com.




RE: log4net RollingLogFileAppender: is this possible to set limit for TOTAL size of all log files?

2012-09-25 Thread Dominik Psenner
If I set
maximumFileSize=10MB and maxSizeRollBackups=10, I will get 10 files for a
Day  with total size 100MB. During the next day (Day+1) I will get
another  10 files for the Day+1  with total size 100MB; the previous 10
files (ones for the Day) will NOT be removed when new files (for the
Day+1) start appearing.

I really tested the Appender in such situation.

So, the limit affects EACH SINGLE DAY; but not the whole bunch of .log
files
in teh given folder

Now I got your point. However, keeping files of past days once the rolling
runs by date is a feature documented also at [2]. There it says:

-- quote --
This example show how to configure the RollingFileAppender to roll log files
on a date period and within a date period on file size. For each day only
the last 10 files of 1MB will be kept.
-- eof quote --

Since you only want to limit the file count anyway, it makes sense to not
roll by date but by file size, doesn't it? Doing so gives you the wanted
behaviour, but filenames won't contain the date. Sorry for the
inconvenience.

Clearly the above is only a workaround and a date in the filename would be
nice, but it is not trivial to implement such a rolling without being
computationally expensive.

The problem lies in identifying the files that should be deleted even if
those files are many thousands or their filename contains a date that is
years in the past. One can either probe a filename or probe if there is a
file for a specific date. Both strategies do not fit into the current
implementation of the rolling file appender. There are several known
problems with the rolling file appender and a rewrite is in discussion. To
document this discussion I've CC'ed the dev mailing list.

If you believe that you need this as a feature, please leave a feature
request in JIRA at [1]. Of course it is no guarantee that one of the
developers will work on this issue any time soon, and therefore I encourage
you to actively work on it if you need it soon. Patches that improve log4net
are always welcome!

Best regards,
Dominik

[1] https://issues.apache.org/jira/browse/LOG4NET
[2] http://logging.apache.org/log4net/release/config-examples.html



Re: UDP Appender in a VPC

2012-10-19 Thread Dominik Psenner
Hi,

maybe your VPN tunnel does not transfer UDP packets? Can you prove
that other UDP datagrams successfully transfer through the VPN?

Cheers,
D.

2012/10/19 Nicola Butcher nicola.butc...@rms.com:
 I have successfully set up a log4net UDP Appender in a non VPC environment = 
 however when I try to do the same thing in a VPN I cannot get it to work. I=  
 have tried opening up all UDP in and outbound ports but it still doesn't n= 
 ot work. My config is as follows.

 log4net debug=3Dtrue
   appender name=3DlogFaces type=3Dlog4net.Appender.UdpAppender
   param name=3DRemoteAddress value=3D10.0.1.7/
   param name=3DRemotePort value=3D7071/
   param name=3DEncoding value=3DUTF-8/
   layout type=3Dlog4net.Layout.XmlLayoutSchemaLog4j, log4net
 locationInfo value=3Dtrue/
   /layout
 /appender
 root
   priority value=3DDEBUG /
   level value=3DALL /
   appender-ref ref=3DlogFaces  /
 /root
   /log4net

 Do I need to set the LocalPort as well as the Remote?

 Thanks Nicki

 This message and any attachments contain information that may be RMS Inc. 
 confidential and/or privileged.  If you are not the intended recipient (or 
 authorized to receive for the intended recipient), and have received this 
 message in error, any use, disclosure or distribution is strictly prohibited. 
   If you have received this message in error, please notify the sender 
 immediately by replying to the e-mail and permanently deleting the message 
 from your computer and/or storage system.




-- 
Dominik Psenner
## OpenPGP Key Signature #
# Key ID: B469318C   #
# Fingerprint: 558641995F7EC2D251354C3A49C7E3D1B469318C  #
##


RE: UDP Appender in a VPC

2012-10-22 Thread Dominik Psenner
I'm glad you were able to sort out this problem on your own. For future
reference, you probably have run into LOG4NET-112:

https://issues.apache.org/jira/browse/LOG4NET-112

There should not have been any other changes to UdpAppender in the 1.2.11
release than adding IPv6 support.

Cheers
--
Dominik Psenner



Re: ListViewAppender: ListView always null?

2012-11-04 Thread Dominik Psenner
Hi

you instantiate it only in one of the constructors. I can't imagine
how that would work.

Cheers,
D.

2012/11/3 BlackMatrix primusla...@web.de:

 Hi.

 Ich have written a ListViewAppender to bind my log messages to a WPF
 listview control.

 Always when I write a log message my application jumps to the

 protected override void Append(LoggingEvent LoggingEvent)

 method of my ListViewAppender, but the _listView is after initialization
 always null.

  public partial class MainWindow : Window
 {
 private static readonly ILog log =
 LogManager.GetLogger(typeof(MainWindow));

 public MainWindow()
 {
 InitializeComponent();

 ListViewAppender listViewAppender = new
 ListViewAppender(listView);

 log.Error(Error.);
 }
 }

 public class ListViewAppender : AppenderSkeleton
 {
 private ListView _listView;

 public ListViewAppender()
 : base()
 {

 }

 public ListViewAppender(ListView listview)
 : base()
 {
 _listView = listview;
 }

 private delegate void UpdateControlDelegate(LoggingEvent
 loggingEvent);

 private void UpdateControl(LoggingEvent loggingEvent)
 {
// ...
 }

 protected override void Append(LoggingEvent LoggingEvent)
 {
 if (!_listView.Dispatcher.CheckAccess())// !!! _listView == null
 _listView.Dispatcher.Invoke(new
 UpdateControlDelegate(UpdateControl), new object[] { LoggingEvent });
 else
 UpdateControl(LoggingEvent);
 }

 XML-Code:
 log4net debug=true
   appender name=ListViewAppender type=WpfApplication2.ListViewAppender
 layout type=log4net.Layout.PatternLayout
   conversionPattern value=%date [%thread] %-5level %logger
 [%property{NDC}] - %message%newline /
 /layout
   /appender

   root
 level value=ALL/
 appender-ref ref=ListViewAppender /
   /root
 /log4net

 C#-Code:

 --
 View this message in context: 
 http://old.nabble.com/ListViewAppender%3A-ListView-always-null--tp34636403p34636403.html
 Sent from the Log4net - Users mailing list archive at Nabble.com.




-- 
Dominik Psenner
## OpenPGP Key Signature #
# Key ID: B469318C   #
# Fingerprint: 558641995F7EC2D251354C3A49C7E3D1B469318C  #
##


Re: ListViewAppender: ListView always null?

2012-11-04 Thread Dominik Psenner
2012/11/4 SEGERS Steven (CNH) steven.seg...@cnh.com:
 What you should do is expose your listview somehow, simplest would be through 
 a static field, and let the no-arg constructor of your appender look up the 
 instance of the listview there.

That would tie the UI and the logging together, which often is not a
good idea. I would instead provide some way to register and unregister
a list view from receiving events through events. But it could be
troublesome to implement the unregister part in a way that just works.
Beware from the Unloaded events - they may show up when you don't
expect them or may not even be triggered at all, which obviously is
even worse.

Cheers,
D.
-- 
Dominik Psenner
## OpenPGP Key Signature #
# Key ID: B469318C   #
# Fingerprint: 558641995F7EC2D251354C3A49C7E3D1B469318C  #
##


Re: How can I get a simple log to write to disk as soon as the message is logged?

2012-12-17 Thread Dominik Psenner
Hey

I would set a rolling size. But log4net not logging is strange. Are
you sure your application generates log messages? You could try to log
them to a console appender too just to make sure. In case you think
that there might be something strange going on, turning on the
internal logging can be very useful.

Cheers,
D.

2012/12/17 Rob Richardson rdrichard...@rad-con.com:
 Greetings!

 I have a very simple log file to generate rolling log files.  I want to 
 ensure that log messages are readable as soon as they are generated.  My log 
 file stayed at 0 bytes as long as my program is running, and then after the 
 program exited the log messages appeared.  Is there a setting I can use to 
 change that behavior?

 Here's the configuration file:

 ?xml version=1.0 encoding=utf-8?
 log4net
   appender name=RollingFile type=log4net.Appender.RollingFileAppender
 file value=CraneInterface.log /
 appendToFile value=true /
 maxSizeRollBackups value=90 /
 rollingStyle value=Size /

 layout type=log4net.Layout.PatternLayout
   conversionPattern value=%date - %message%newline /
 /layout
   /appender

   root
level value=DEBUG /
   appender-ref ref=RollingFile /
   /root

 /log4net


 Thank you very much.



-- 
Dominik Psenner
## OpenPGP Key Signature #
# Key ID: B469318C   #
# Fingerprint: 558641995F7EC2D251354C3A49C7E3D1B469318C  #
##


Re: log4net in medium trust ASP.NET 4.x

2013-01-02 Thread Dominik Psenner

On 01/02/2013 04:07 PM, Andrew Arnott wrote:
I noticed [an issue][1] is already filed for this. But it seems to be 
dormant and the proposed fix was apparently difficult. I’ve added 
comments to the issue that offer two alternatives for fixing it that 
are both one-liners, and both arguably a better fix than the proposed 
one. Can anyone reply with whether they agree


I responded. Future discussion can take place within JIRA.


, and/or with a timeline of when we expect this problem to be solved?


Cannot make promises. I'm at the moment in the Netherlands and I don't 
know when there'll be enough spare time to look into this. However, as 
commented in JIRA, I'll accept any sensible patch.


Cheers,
D.


RE: log4net:ERROR Failed to append to appender [EventLogAppender]

2013-01-09 Thread Dominik Psenner
Hi,

 

did this happen near the end of the process lifetime (i.e. when you closed
the application that uses log4net for logging)?

 

Cheers,

D.

 

  _  

From: Dmitry Pogodin [mailto:lunatic...@gmail.com] 
Sent: Wednesday, January 09, 2013 11:38 AM
To: log4net-user@logging.apache.org
Subject: log4net:ERROR Failed to append to appender [EventLogAppender]

 

Good time of day to you!

 

I've got the following exception while using log4net:


log4net:ERROR Failed to append to appender [EventLogAppender]
System.Threading.ThreadAbortException: Thread was being aborted.
   at System.Threading.Monitor.Enter(Object obj)
   at log4net.Appender.AppenderSkeleton.DoAppend(LoggingEvent loggingEvent)
   at log4net.Util.AppenderAttachedImpl.AppendLoopOnAppenders(LoggingEvent
loggi
ngEvent)
log4net:ERROR Exception while logging
System.Threading.ThreadAbortException: Thread was being aborted.
   at log4net.Util.AppenderAttachedImpl.AppendLoopOnAppenders(LoggingEvent
loggi
ngEvent)
   at log4net.Repository.Hierarchy.Logger.CallAppenders(LoggingEvent
loggingEven
t)
   at log4net.Repository.Hierarchy.Logger.ForcedLog(Type
callerStackBoundaryDecl
aringType, Level level, Object message, Exception exception)
   at log4net.Repository.Hierarchy.Logger.Log(Type
callerStackBoundaryDeclaringT
ype, Level level, Object message, Exception exception)

I use the following config:



log4net
root
  level value=ALL/
  appender-ref ref=EventLogAppender/
/root
appender name=EventLogAppender
type=log4net.Appender.EventLogAppender 
  logName value=TestLog
applicationName value=SampleApp /
  /logName
  layout type=log4net.Layout.PatternLayout
conversionPattern value=%date %logger - %message%newline /
  /layout
/appender
  /log4net

Ready to give more information if you need.

 

Best regards, lunaticare

 



RE: log4net:ERROR Failed to append to appender [EventLogAppender]

2013-01-09 Thread Dominik Psenner
In this case I would argument that you have a worker thread that you don't
properly terminate by exiting from the worker thread loop with a break or
return or you have forgot to set IsBackground=true on the worker thread such
that it can be terminated by the process automatically.

 

  _  

From: lunaticare [mailto:lunatic...@gmail.com] 
Sent: Wednesday, January 09, 2013 1:36 PM
To: Log4NET User
Subject: Re: log4net:ERROR Failed to append to appender [EventLogAppender]

 

Hello Dominik,

you're right, this happens when application closes.

 

2013/1/9 Dominik Psenner dpsen...@gmail.com

Hi,

 

did this happen near the end of the process lifetime (i.e. when you closed
the application that uses log4net for logging)?

 

Cheers,

D.

 

  _  

From: Dmitry Pogodin [mailto:lunatic...@gmail.com] 
Sent: Wednesday, January 09, 2013 11:38 AM
To: log4net-user@logging.apache.org
Subject: log4net:ERROR Failed to append to appender [EventLogAppender]

 

Good time of day to you!

 

I've got the following exception while using log4net:


log4net:ERROR Failed to append to appender [EventLogAppender]
System.Threading.ThreadAbortException: Thread was being aborted.
   at System.Threading.Monitor.Enter(Object obj)
   at log4net.Appender.AppenderSkeleton.DoAppend(LoggingEvent loggingEvent)
   at log4net.Util.AppenderAttachedImpl.AppendLoopOnAppenders(LoggingEvent
loggi
ngEvent)
log4net:ERROR Exception while logging
System.Threading.ThreadAbortException: Thread was being aborted.
   at log4net.Util.AppenderAttachedImpl.AppendLoopOnAppenders(LoggingEvent
loggi
ngEvent)
   at log4net.Repository.Hierarchy.Logger.CallAppenders(LoggingEvent
loggingEven
t)
   at log4net.Repository.Hierarchy.Logger.ForcedLog(Type
callerStackBoundaryDecl
aringType, Level level, Object message, Exception exception)
   at log4net.Repository.Hierarchy.Logger.Log(Type
callerStackBoundaryDeclaringT
ype, Level level, Object message, Exception exception)

I use the following config:

log4net
root
  level value=ALL/
  appender-ref ref=EventLogAppender/
/root
appender name=EventLogAppender
type=log4net.Appender.EventLogAppender 
  logName value=TestLog
applicationName value=SampleApp /
  /logName
  layout type=log4net.Layout.PatternLayout
conversionPattern value=%date %logger - %message%newline /
  /layout
/appender
  /log4net

Ready to give more information if you need.

 

Best regards, lunaticare

 

 



Re: log4net:ERROR Failed to append to appender [EventLogAppender]

2013-01-10 Thread Dominik Psenner
You're welcome and thanks for the Kudos.

2013/1/10 lunaticare lunatic...@gmail.com:
 Dominik, you were right. Setting IsBackground=true did solve the problem.

 Thank you very much for your assistance and such a great library!


 2013/1/9 Dominik Psenner dpsen...@gmail.com

 In this case I would argument that you have a worker thread that you don’t
 properly terminate by exiting from the worker thread loop with a break or
 return or you have forgot to set IsBackground=true on the worker thread such
 that it can be terminated by the process automatically.



 

 From: lunaticare [mailto:lunatic...@gmail.com]
 Sent: Wednesday, January 09, 2013 1:36 PM
 To: Log4NET User
 Subject: Re: log4net:ERROR Failed to append to appender [EventLogAppender]



 Hello Dominik,

 you're right, this happens when application closes.



 2013/1/9 Dominik Psenner dpsen...@gmail.com

 Hi,



 did this happen near the end of the process lifetime (i.e. when you closed
 the application that uses log4net for logging)?



 Cheers,

 D.



 

 From: Dmitry Pogodin [mailto:lunatic...@gmail.com]
 Sent: Wednesday, January 09, 2013 11:38 AM
 To: log4net-user@logging.apache.org
 Subject: log4net:ERROR Failed to append to appender [EventLogAppender]



 Good time of day to you!



 I've got the following exception while using log4net:


 log4net:ERROR Failed to append to appender [EventLogAppender]
 System.Threading.ThreadAbortException: Thread was being aborted.
at System.Threading.Monitor.Enter(Object obj)
at log4net.Appender.AppenderSkeleton.DoAppend(LoggingEvent
 loggingEvent)
at log4net.Util.AppenderAttachedImpl.AppendLoopOnAppenders(LoggingEvent
 loggi
 ngEvent)
 log4net:ERROR Exception while logging
 System.Threading.ThreadAbortException: Thread was being aborted.
at log4net.Util.AppenderAttachedImpl.AppendLoopOnAppenders(LoggingEvent
 loggi
 ngEvent)
at log4net.Repository.Hierarchy.Logger.CallAppenders(LoggingEvent
 loggingEven
 t)
at log4net.Repository.Hierarchy.Logger.ForcedLog(Type
 callerStackBoundaryDecl
 aringType, Level level, Object message, Exception exception)
at log4net.Repository.Hierarchy.Logger.Log(Type
 callerStackBoundaryDeclaringT
 ype, Level level, Object message, Exception exception)

 I use the following config:

 log4net

 root

   level value=ALL/

   appender-ref ref=EventLogAppender/

 /root

 appender name=EventLogAppender
 type=log4net.Appender.EventLogAppender 

   logName value=TestLog

 applicationName value=SampleApp /

   /logName

   layout type=log4net.Layout.PatternLayout

 conversionPattern value=%date %logger - %message%newline /

   /layout

 /appender

   /log4net

 Ready to give more information if you need.



 Best regards, lunaticare









-- 
Dominik Psenner
## OpenPGP Key Signature #
# Key ID: B469318C   #
# Fingerprint: 558641995F7EC2D251354C3A49C7E3D1B469318C  #
##


Nightly builds

2013-02-26 Thread Dominik Psenner
Hi there,

Andrew Arnott posted that he is interested in nightly builds of log4net. 
Therefore I am hereby raising a poll to see if also the
community is interested. Please post back with your opinion by placing a cross 
and optionally a small comment. Just like this:

-- DUMMY --
[ ] Yes
[X] No, no need

Yes, cool. We could finally get our hands on builds with our latest bug fixes 
and test them!
-- DUMMY --

Let us know what you think about this idea!

Cheers,
D.



RE: Nightly builds

2013-03-05 Thread Dominik Psenner
Hi there,

the poll ended some hour ago and I wanted to give it a little more time. But 
unfortunately that did not help and only a few people
participated. Even though 2 ouf of 4 people who shared their opinion are 
interested in nightly builds, there does not seem to be
enough interest in the community to pursue this idea.
 
Cheers,
D.



RE: Log4net NOT working on .net 4.5

2013-04-09 Thread Dominik Psenner
Hi,

 

You provide not enough information so that someone could help you finding out 
what's wrong. If you referenced the log4net DLL,
configured the appenders properly and are writing some log messages but still 
nothing happens, it is always a good idea to enable
log4net's internal logging to trace what's going on. All those steps should be 
covered in the FAQ section on the website.

 

Cheers,

D.

 

  _  

From: El Tigre [mailto:el_tigre...@yahoo.com] 
Sent: Tuesday, April 09, 2013 12:24 PM
To: log4net-user@logging.apache.org
Subject: Log4net NOT working on .net 4.5

 

I tried to make log4net work in my application with .net 4.5. It doesn't give 
me an error but I don't see the log file

I made all the changes, imported all things but no success...



RE: Log4net NOT working on .net 4.5

2013-04-09 Thread Dominik Psenner
I forgot to quote [1]. .NET 4.5 is not among the officially supported .NET 
frameworks yet. IMHO you should be able to use log4net's
.NET 4.0 build with the .NET 4.5 framework, but there may be unknown issues 
ahead. Please check [2] for changes that could break
appenders you are using (i.e. if you are trying to use AdoNetAppender to log 
into a SQL Server 1997 database).

 

Cheers,

D.

 

[1] http://logging.apache.org/log4net/release/features.html#frameworks

[2] http://msdn.microsoft.com/en-us/library/hh367887.aspx

 

  _  

From: Dominik Psenner [mailto:dpsen...@gmail.com] 
Sent: Tuesday, April 09, 2013 1:35 PM
To: 'Log4NET User'; 'El Tigre'
Subject: RE: Log4net NOT working on .net 4.5

 

Hi,

 

You provide not enough information so that someone could help you finding out 
what's wrong. If you referenced the log4net DLL,
configured the appenders properly and are writing some log messages but still 
nothing happens, it is always a good idea to enable
log4net's internal logging to trace what's going on. All those steps should be 
covered in the FAQ section on the website.

 

Cheers,

D.

 

  _  

From: El Tigre [mailto:el_tigre...@yahoo.com] 
Sent: Tuesday, April 09, 2013 12:24 PM
To: log4net-user@logging.apache.org
Subject: Log4net NOT working on .net 4.5

 

I tried to make log4net work in my application with .net 4.5. It doesn't give 
me an error but I don't see the log file

I made all the changes, imported all things but no success...



Re: Log4net NOT working on .net 4.5

2013-04-10 Thread Dominik Psenner
Thanks Andrew and George for your feedback. I expected that log4net works
with .NET 4.5 - except for some cases that are covered in the migration
article from microsoft. Please post a sample project that does not work and
then maybe we are able to trace what's going wrong.


2013/4/9 George Chung geo...@glympse.com

 I use log4net with .NET 4.5 all the time without problem.


 ditto.


 On Tue, Apr 9, 2013 at 7:09 AM, Andrew Arnott andrewarn...@gmail.comwrote:

 I use log4net with .NET 4.5 all the time without problem.
 The most common cause for no log file that I've heard of is that you
 build against one version of log4net and run against a different one, or
 have the wrong bindingRedirects in your .config file.

 --
 Andrew Arnott
 I [may] not agree with what you have to say, but I'll defend to the
 death your right to say it. - S. G. Tallentyre


 On Tue, Apr 9, 2013 at 5:37 AM, El Tigre el_tigre...@yahoo.com wrote:


 All is setup correctly (I have used log4net in the past) but is not
 working for my project with .net 4.5
 And I must use .net 4.5






-- 
Dominik Psenner
## OpenPGP Key Signature #
# Key ID: B469318C   #
# Fingerprint: 558641995F7EC2D251354C3A49C7E3D1B469318C  #
##


RE: Log4net NOT working on .net 4.5

2013-04-10 Thread Dominik Psenner
Did you place that statement outside of any method or constructor?

 

  _  

From: El Tigre [mailto:el_tigre...@yahoo.com] 
Sent: Wednesday, April 10, 2013 9:34 AM
To: Log4NET User
Subject: Re: Log4net NOT working on .net 4.5

 

with all respect, but I read the manual and the configuration settings

 

BasicConfigurator.Configure(); it gives me and error saying ...It's a method 
but is used like a type

 

El TigreT C

  _  

From: Dominik Psenner dpsen...@gmail.com
To: 'Log4NET User' log4net-user@logging.apache.org; 'El Tigre' 
el_tigre...@yahoo.com 
Sent: Wednesday, April 10, 2013 10:24 AM
Subject: RE: Log4net NOT working on .net 4.5

 

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

 

RTFM

 

PS: no offense meant :-)

 

  _  

From: El Tigre [mailto:el_tigre...@yahoo.com] 
Sent: Wednesday, April 10, 2013 9:19 AM
To: Log4NET User
Subject: Re: Log4net NOT working on .net 4.5

 

That command is not working on the new 1.2.1.1...

I didn't know I have to run such a command..

 

Can you give an example for my project and my version of log4net?

 



RE: Log4net NOT working on .net 4.5

2013-04-10 Thread Dominik Psenner
I'm glad you finally worked it out and I hope you learned something. In the 
future you should consult the manuals and check if
you're doing things how it's written down in the manuals. Posting something 
like all is setup correctly (I have used log4net in the
past) without being sure can cause embarassing reactions. :-)

 

Cheers,

D.

 

  _  

From: El Tigre [mailto:el_tigre...@yahoo.com] 
Sent: Wednesday, April 10, 2013 10:08 AM
To: Log4NET User
Subject: Re: Log4net NOT working on .net 4.5

 


GOT it... had to put the initialize method din the constructor without 
parameters: 

 

public Form1()

{

InitializeComponent();

XmlConfigurator.Configure();

 }

 

NOw it works! thank you for help!



Re: log4net with IntelliTrace

2013-05-06 Thread Dominik Psenner
Hi Todd,

Feel free to implement your custom appender that sinks events into
IntelliTrace. If you're willing to share your achievements and if
microsofts licensing allows log4net to invoke IntelliTrace, we would be
happy to accept any sensible patches.

Cheers,
D.


2013/5/6 Todd Bradley todd.brad...@nirvanix.com

  Yup. We’re using VS Ultimate for load testing, and the tests are based
 on some functional tests that we’re trying to use log4net with. We like
 Apache Logging, as two of us have used log4j at other companies before we
 came to this C# shop. But we’re still trying to come to grips with all the
 changes in environments.

 ** **

 ** **

 ** **

 *From:* Sam Carter [mailto:cppprogram...@live.com]
 *Sent:* Thursday, May 02, 2013 7:09 PM
 *To:* Log4net User Group
 *Subject:* RE: log4net with IntelliTrace

 ** **

 I think you need Visual Studio Ultimate to use it (i.e. hefty license cost)
 
  --

 From: todd.brad...@nirvanix.com
 To: log4net-user@logging.apache.org
 Subject: log4net with IntelliTrace
 Date: Thu, 2 May 2013 18:09:40 +

 Has anyone tried integrating log4net with Microsoft IntelliTrace?

  

 http://msdn.microsoft.com/en-us/library/vstudio/dd264915.aspx

  

 That’s their system for recording “events” that happened during execution
 of an app, such as debugger events, exceptions, etc. I haven’t personally
 used it, but IntelliTrace sounds like it might be useful for
 troubleshooting distributed load tests, and we’re standardizing on log4net
 for logging in our test code.

  

  

 Cheers,

 Todd.




-- 
Dominik Psenner
## OpenPGP Key Signature #
# Key ID: B469318C   #
# Fingerprint: 558641995F7EC2D251354C3A49C7E3D1B469318C  #
##


Re: log4net with IntelliTrace

2013-05-06 Thread Dominik Psenner
The learning curve shouldn't be too steep as long as microsoft provides an
API to which you can attach to or invoke into.


2013/5/6 Todd Bradley todd.brad...@nirvanix.com

  I’ll keep that in mind. The biggest hurdle, I imagine, would be finding
 a way to stream events into Microsoft’s system. I seriously doubt they
 designed it to be easy to integrate 3rd party tools with, though I could
 be wrong!

 ** **

 ** **

 Thanks,

 Todd.

 ** **

 *From:* Dominik Psenner [mailto:dpsen...@gmail.com]
 *Sent:* Monday, May 06, 2013 11:12 AM
 *To:* Log4NET User
 *Subject:* Re: log4net with IntelliTrace

 ** **

 Hi Todd,

 ** **

 Feel free to implement your custom appender that sinks events into
 IntelliTrace. If you're willing to share your achievements and if
 microsofts licensing allows log4net to invoke IntelliTrace, we would be
 happy to accept any sensible patches.

 ** **

 Cheers,

 D.

 ** **

 2013/5/6 Todd Bradley todd.brad...@nirvanix.com

 Yup. We’re using VS Ultimate for load testing, and the tests are based on
 some functional tests that we’re trying to use log4net with. We like Apache
 Logging, as two of us have used log4j at other companies before we came to
 this C# shop. But we’re still trying to come to grips with all the changes
 in environments.

  

  

  

 *From:* Sam Carter [mailto:cppprogram...@live.com]
 *Sent:* Thursday, May 02, 2013 7:09 PM
 *To:* Log4net User Group
 *Subject:* RE: log4net with IntelliTrace

  

 I think you need Visual Studio Ultimate to use it (i.e. hefty license cost)
 
  --

 From: todd.brad...@nirvanix.com
 To: log4net-user@logging.apache.org
 Subject: log4net with IntelliTrace
 Date: Thu, 2 May 2013 18:09:40 +

 Has anyone tried integrating log4net with Microsoft IntelliTrace?

  

 http://msdn.microsoft.com/en-us/library/vstudio/dd264915.aspx

  

 That’s their system for recording “events” that happened during execution
 of an app, such as debugger events, exceptions, etc. I haven’t personally
 used it, but IntelliTrace sounds like it might be useful for
 troubleshooting distributed load tests, and we’re standardizing on log4net
 for logging in our test code.

  

  

 Cheers,

 Todd.



 

 ** **

 --
 Dominik Psenner
 ## OpenPGP Key Signature #
 # Key ID: B469318C   #
 # Fingerprint: 558641995F7EC2D251354C3A49C7E3D1B469318C  #
 ##




-- 
Dominik Psenner
## OpenPGP Key Signature #
# Key ID: B469318C   #
# Fingerprint: 558641995F7EC2D251354C3A49C7E3D1B469318C  #
##


AW: How to force log4net to refresh timezone information?

2013-05-23 Thread Dominik Psenner
Hi

 

I'm wondering, how often does your deployment computer travel from one
timezone to another while it is powered on?

 

Cheers,

D.

 

Von: Warrick Wilson [mailto:guywithd...@gmail.com] 
Gesendet: Donnerstag, 23. Mai 2013 05:55
An: log4net-user@logging.apache.org
Betreff: How to force log4net to refresh timezone information?

 

I've inherited a project that users log4net to do some logging. One of the
things that got noticed was that changes to the timezone on the PC that the
program runs on don't get the logging times changed (e.g. changing the
timezone from Pacific to Eastern does not change the logging time by 3
hours)

 

The program code that was written by us has routines in that trap an event
for timezone changes and call TimeZoneInfo.ClearCachedData() (something like
that... doing this from memory).

 

Is there a call that can be made to get the log4net innards to do the same
sort of thing?



AW: How to force log4net to refresh timezone information?

2013-05-23 Thread Dominik Psenner
In aircrafts the UTC timezone is used. And one is not allowed to use laptops 
during starts and landings. :-)

To come back to topic: is the time zone changed within an application or via 
the windows control panel that can be opened by following the guide below?

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/windows_date_change_time.mspx?mfr=true

-Ursprüngliche Nachricht-
Von: Christian Grobmeier [mailto:grobme...@gmail.com] 
Gesendet: Donnerstag, 23. Mai 2013 12:00
An: Log4NET User
Betreff: Re: How to force log4net to refresh timezone information?

Hi,

On Thu, May 23, 2013 at 11:31 AM, Dominik Psenner dpsen...@gmail.com wrote:
 I’m wondering, how often does your deployment computer travel from one
 timezone to another while it is powered on?

Maybe its an app for use in aircraft? You never know...



 Von: Warrick Wilson [mailto:guywithd...@gmail.com]
 Gesendet: Donnerstag, 23. Mai 2013 05:55
 An: log4net-user@logging.apache.org
 Betreff: How to force log4net to refresh timezone information?

 I've inherited a project that users log4net to do some logging. One of the
 things that got noticed was that changes to the timezone on the PC that the
 program runs on don't get the logging times changed (e.g. changing the
 timezone from Pacific to Eastern does not change the logging time by 3
 hours)



 The program code that was written by us has routines in that trap an event
 for timezone changes and call TimeZoneInfo.ClearCachedData() (something like
 that... doing this from memory).



 Is there a call that can be made to get the log4net innards to do the same
 sort of thing?



--
http://www.grobmeier.de
https://www.timeandbill.de



AW: How to force log4net to refresh timezone information?

2013-05-23 Thread Dominik Psenner
I was able to reproduce the issue and - whether this is right or not - the 
microsoft developers have decided that changes in the system settings are not 
pushed to running (.NET) processes. Instead every process caches culture 
information and the cached information is used until it is explicitly 
refreshed. So the issue you observed is not something that affects only 
log4net, but it is something that affects all .NET applications around the 
globe. If you're happy with that explanation don't read on. More fancy stuff 
follows.

First I did not believe it would be so. Thus I wrote a small test application 
that does not much but display the current time:

public partial class MainWindow : Window
{
private static readonly ILog log = 
LogManager.GetLogger(typeof(MainWindow));

static MainWindow()
{
BasicConfigurator.Configure();
}

public MainWindow()
{
InitializeComponent();

DispatcherTimer dt = new DispatcherTimer();
dt.Interval = TimeSpan.FromSeconds(1);
dt.Tick += dt_Tick;
dt.Start();
}

void dt_Tick(object sender, EventArgs e)
{
if (ClearCachedDataCheckBox.IsChecked.Value)
{
CultureInfo.CurrentCulture.ClearCachedData();
}

DateTime localNow = DateTime.Now;
DateTime utcNow = DateTime.UtcNow;

string localNowString = 
localNow.ToString(CultureInfo.InvariantCulture);
string utcNowString = 
utcNow.ToString(CultureInfo.InvariantCulture);

log.InfoFormat(Local time='{0}'; UTC time='{1}', 
localNowString, utcNowString);
LocalTimeLabel.Content = localNowString;
UtcTimeLabel.Content = utcNowString;
}
} 

So I could see that the time did indeed not update itself until I checked the 
ClearCachedDataCheckBox and ClearCachedData was invoked. And I can also 
understand why microsoft decided to make it behave like this. Imagine what 
would happen if your program depends on an ever-increasing timestamp from 
DateTime.Now. I.e. something like:

DateTime lastTime = DateTime.MinValue;
while(true) {
if(lastTime + TimeSpan.FromMinutes(1)  DateTime.Now) {
try {
// do an important operation every 1 minutes
} finally {
lastTime = DateTime.Now;
}
}
}

This going to fail if someone changes the timezone so that the local time goes 
into the past. Your code won't be executed for the amount of hours he travelled 
back into the past. Of course one could work around this issue by comparing the 
UNIX timestamp and doing modulo operations, but there are a lot of lazy 
developers on earth and the real world is a messy place. ;-) Please note also 
that my example is a simple single-threaded one. The above might not work 
anymore as soon as you start with multi-threading. The CultureInfo properties 
are, AFAIK, thread-static.

Cheers,
D.

-Ursprüngliche Nachricht-
Von: Dominik Psenner [mailto:dpsen...@gmail.com] 
Gesendet: Donnerstag, 23. Mai 2013 13:13
An: 'Log4NET User'
Betreff: AW: How to force log4net to refresh timezone information?

In aircrafts the UTC timezone is used. And one is not allowed to use laptops 
during starts and landings. :-)

To come back to topic: is the time zone changed within an application or via 
the windows control panel that can be opened by following the guide below?

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/windows_date_change_time.mspx?mfr=true

-Ursprüngliche Nachricht-
Von: Christian Grobmeier [mailto:grobme...@gmail.com] 
Gesendet: Donnerstag, 23. Mai 2013 12:00
An: Log4NET User
Betreff: Re: How to force log4net to refresh timezone information?

Hi,

On Thu, May 23, 2013 at 11:31 AM, Dominik Psenner dpsen...@gmail.com wrote:
 I’m wondering, how often does your deployment computer travel from one
 timezone to another while it is powered on?

Maybe its an app for use in aircraft? You never know...



 Von: Warrick Wilson [mailto:guywithd...@gmail.com]
 Gesendet: Donnerstag, 23. Mai 2013 05:55
 An: log4net-user@logging.apache.org
 Betreff: How to force log4net to refresh timezone information?

 I've inherited a project that users log4net to do some logging. One of the
 things that got noticed was that changes to the timezone on the PC that the
 program runs on don't get the logging times changed (e.g. changing the
 timezone from Pacific to Eastern does not change the logging time by 3
 hours)



 The program code that was written by us has routines

AW: log4net.dll version 1.2.10.0 (FileSystemWatcher objects)

2013-05-24 Thread Dominik Psenner
Good morning Yuvraj,

 

There's no way of being sure unless you have tried it out with your
application or a sample application that uses log4net in the same way you
do. Of course a sample application could do things faster than normal and in
an automated way so that the problem happens sooner and not only after 3
months. :)

 

So my testing setup would be two identical virtual machines. The first runs
the application against 1.2.10 and the second runs the application against
1.2.11. This way you can expect to see:

 

* Virtual machine #1 leaks memory

* Virtual machine #2 either does or doesn't leak memory

 

Cheers

 

Von: Yuvraj Raj [mailto:r...@michaels.com] 
Gesendet: Donnerstag, 23. Mai 2013 20:27
An: log4net-...@logging.apache.org
Betreff: log4net.dll version 1.2.10.0 (FileSystemWatcher objects)

 

Hi,

 

I am application developer team supporting.NET project in Michaels Stores.
We have been using log4net.dll version 1.2.10.0 for application logs for our
project. The application is implemented in .NET , C# with 3.5 framework.

 

Recently we have faced System.OutOfMemoryException exception thrown by the
application. We have opened case with Microsoft.  Microsoft analyzed and
said memory consumption is due to FileSystemWatcher objects used by
log4net.Config.XmlConfigurator+ConfigureAndWatchHandler which are still
alive and pinned objects.

 

From the memory dump, They found 2000 instances of
log4net.Config.XmlConfigurator+ConfigureAndWatchHandler and the
FileSystemWatcher objects created that contributed this issue. The issue is
happening due to the fragmentation of Gen2 Heap. The reason for the
fragmentation is the pinned System.IO.Overlapped objects used by
FileSystemWatcher objects.

 

To resolve the memory  issue, we need to get rid of the fragmentation caused
by pinned objects used by FileSystemWatcher objects

 

We have created logger object in singleton class but not sure how multiple
objects are being created.

 

When looking at the log4net.dll help from Apache web page, we found the
below link for log4net that have bug (LOG4NET-158) in version 1.2.10.0
saying XmlConfigurator.ConfigureAndWatch() leaks resources if called
multiple times

 

 
https://issues.apache.org/jira/browse/LOG4NET-158?page=com.atlassian.jira.p
lugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12601148#actio
n_12601148
https://issues.apache.org/jira/browse/LOG4NET-158?page=com.atlassian.jira.pl
ugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12601148#action
_12601148

 

The issue was fixed in version 1.2.11.0. Please let us know if above memory
issue was related to the bug and it has been resolved in the next release. 

 

Any help would be greatly appreciated.

 

 

 

Best Regards,

Yuvraj

Work: 972 409 5703 | Support: 972 400 0174 | Cell: 469 438 1396

 



_
Scanned by IBM Email Security Management Services powered by MessageLabs.
For more information please visit
http://www-935.ibm.com/services/us/index.wss/offerfamily/iss/a1026954

_



AW: Log4Net works in Dev without calling XMLConfigurator?

2013-06-17 Thread Dominik Psenner
Hi

For what it's worth, the logging should be initialized with the default 
settings. That happens to be a root logger and nothing more. So the apparently 
working loggers may be just an illusion.

Cheers,
D.

-Ursprüngliche Nachricht-
Von: psandler [mailto:psandle...@yahoo.com]
Gesendet: Freitag, 14. Juni 2013 14:54
An: log4net-user@logging.apache.org
Betreff: Log4Net works in Dev without calling XMLConfigurator?

Stackoverflow post is here:
http://stackoverflow.com/questions/17091629/log4net-not-logging-when-
deployed?noredirect=1#comment24743599_17091629

Couldn’t get it working when deployed, but someone pointed out that I had
to
call XMLConfigurator, which I neglected to do, despite the fact that I have
used log4net dozens of times.  I was also missing the reference to the
log4net section in the configSections area of my web.config.

For some reason, the logging still works in my development environment (i.e.
while debugging).

Is this normal?  What causes log4Net to get wired up correctly even without
the correct web.config reference and calling XMLConfigurator?




--
View this message in context: http://apache-
logging.6191.n7.nabble.com/Log4Net-works-in-Dev-without-calling-
XMLConfigurator-tp38348.html
Sent from the Log4net - Users mailing list archive at Nabble.com.



AW: log4net runtime error - Failed to Marshal remoting sink

2013-08-07 Thread Dominik Psenner
This is most probably related to this:

 

 http://msdn.microsoft.com/en-us/library/dd233102.aspx
http://msdn.microsoft.com/en-us/library/dd233102.aspx

 

Known as:

 

 http://issues.apache.org/jira/browse/LOG4NET-347
http://issues.apache.org/jira/browse/LOG4NET-347

 

And fixed since revision:

 

1446054 

 

Which is due for the release of 1.2.12. If you want to give it a shot, feel
free to build log4net from svn.

 

Cheers

 

Von: Joshua Go [mailto:j...@nyx.com] 
Gesendet: Mittwoch, 7. August 2013 16:05
An: Log4NET User; 'Guanrao Chen'
Betreff: RE: log4net runtime error - Failed to Marshal remoting sink

 

We were using the latest release that was available for download at
http://nuget.org and http://logging.apache.org/log4net/download_log4net.cgi,
which is 1.2.11.

 

From: Guanrao Chen [mailto:guan...@yahoo.com] 
Sent: Tuesday, August 06, 2013 4:48 PM
To: Log4NET User
Subject: Re: log4net runtime error - Failed to Marshal remoting sink

 

Were u using the latest version? Try the latest ..

 


Thanks,
Guanrao

http://www.foundyo.com http://www.foundyo.com/   where fun and easy
friend-making happens

 

  _  

From: Joshua Go j...@nyx.com mailto:j...@nyx.com 
To: 'log4net-user@logging.apache.org' log4net-user@logging.apache.org
mailto:log4net-user@logging.apache.org  
Sent: Thursday, July 25, 2013 11:01 AM
Subject: log4net runtime error - Failed to Marshal remoting sink


Hi,

I have a C# 4.0 project using log4net, and I recently tried to create a
remote logging server. It works with 1.2.10.0, but when I switch to 1.2.11.0
I get an ERROR at runtime.

log4net:ERROR Failed to Marshal remoting sink
System.MethodAccessException: 
Attempt by method
'log4net.Plugin.RemoteLoggingServerPlugin.Attach(log4net.Repository.ILoggerR
epository)' to access method
'System.Runtime.Remoting.RemotingServices.Marshal(System.MarshalByRefObject,
System.String, System.Type)' failed. at
log4net.Plugin.RemoteLoggingServerPlugin.Attach(ILoggerRepository
repository)

I found one post on Stackoverflow with the exact problem, but no solution.
http://stackoverflow.com/questions/16914357/upgrade-log4net-from-1-2-10-0-to
-1-2-11-0-on-net-framework-4-0-security

Is this a bug or a security configuration that I missed?
Any help would be greatly appreciated.


Thanks,
Josh
Please consider the environment before printing this email.

Visit our website at http://www.nyse.com http://www.nyse.com/ 



Note:  The information contained in this message and any attachment to it is
privileged, confidential and protected from disclosure.  If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited.  If you have received this
communication in error, please notify the sender immediately by replying to
the message, and please delete it from your system.  Thank you.  NYSE
Euronext.

  _  

Please consider the environment before printing this email.

Visit our website at http://www.nyse.com 

* 
Note: The information contained in this message and any attachment to it is
privileged, confidential and protected from disclosure. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited. If you have received this
communication in error, please notify the sender immediately by replying to
the message, and please delete it from your system. Thank you. NYSE
Euronext. 



AW: log4net runtime error - Failed to Marshal remoting sink

2013-08-08 Thread Dominik Psenner
I'm glad we were able to help you.

 

We're trying hard to get 1.2.12 baked as soon as we can. Anyway I want to
encourage you to try your use case with log4net built from the current
sources just to be sure it will be fixed with 1.2.12. We could fix whatever
does not work with the release after 1.2.12, but - according to the current
log4net release statistics - it may take several months until that happens.
;-)

 

Cheers

 

Von: Joshua Go [mailto:j...@nyx.com] 
Gesendet: Mittwoch, 7. August 2013 16:47
An: 'Log4NET User'
Betreff: RE: log4net runtime error - Failed to Marshal remoting sink

 

Thanks for the links Dominik. Stefan B also said LOG4NET-318 is related to
this, and should be fixed after 1.2.11.

 

When I get a chance, I will try the 1.2.12 version.

 

From: Dominik Psenner [mailto:dpsen...@gmail.com] 
Sent: Wednesday, August 07, 2013 10:39 AM
To: 'Log4NET User'
Subject: AW: log4net runtime error - Failed to Marshal remoting sink

 

This is most probably related to this:

 

 http://msdn.microsoft.com/en-us/library/dd233102.aspx
http://msdn.microsoft.com/en-us/library/dd233102.aspx

 

Known as:

 

 http://issues.apache.org/jira/browse/LOG4NET-347
http://issues.apache.org/jira/browse/LOG4NET-347

 

And fixed since revision:

 

1446054 

 

Which is due for the release of 1.2.12. If you want to give it a shot, feel
free to build log4net from svn.

 

Cheers

 

Von: Joshua Go [mailto:j...@nyx.com] 
Gesendet: Mittwoch, 7. August 2013 16:05
An: Log4NET User; 'Guanrao Chen'
Betreff: RE: log4net runtime error - Failed to Marshal remoting sink

 

We were using the latest release that was available for download at
http://nuget.org and http://logging.apache.org/log4net/download_log4net.cgi,
which is 1.2.11.

 

From: Guanrao Chen [mailto:guan...@yahoo.com] 
Sent: Tuesday, August 06, 2013 4:48 PM
To: Log4NET User
Subject: Re: log4net runtime error - Failed to Marshal remoting sink

 

Were u using the latest version? Try the latest ..

 


Thanks,
Guanrao

http://www.foundyo.com http://www.foundyo.com/   where fun and easy
friend-making happens

 

  _  

From: Joshua Go j...@nyx.com mailto:j...@nyx.com 
To: 'log4net-user@logging.apache.org' log4net-user@logging.apache.org
mailto:log4net-user@logging.apache.org  
Sent: Thursday, July 25, 2013 11:01 AM
Subject: log4net runtime error - Failed to Marshal remoting sink


Hi,

I have a C# 4.0 project using log4net, and I recently tried to create a
remote logging server. It works with 1.2.10.0, but when I switch to 1.2.11.0
I get an ERROR at runtime.

log4net:ERROR Failed to Marshal remoting sink
System.MethodAccessException: 
Attempt by method
'log4net.Plugin.RemoteLoggingServerPlugin.Attach(log4net.Repository.ILoggerR
epository)' to access method
'System.Runtime.Remoting.RemotingServices.Marshal(System.MarshalByRefObject,
System.String, System.Type)' failed. at
log4net.Plugin.RemoteLoggingServerPlugin.Attach(ILoggerRepository
repository)

I found one post on Stackoverflow with the exact problem, but no solution.
http://stackoverflow.com/questions/16914357/upgrade-log4net-from-1-2-10-0-to
-1-2-11-0-on-net-framework-4-0-security

Is this a bug or a security configuration that I missed?
Any help would be greatly appreciated.


Thanks,
Josh
Please consider the environment before printing this email.

Visit our website at http://www.nyse.com http://www.nyse.com/ 



Note:  The information contained in this message and any attachment to it is
privileged, confidential and protected from disclosure.  If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited.  If you have received this
communication in error, please notify the sender immediately by replying to
the message, and please delete it from your system.  Thank you.  NYSE
Euronext.

  _  

Please consider the environment before printing this email.

Visit our website at http://www.nyse.com 

* 
Note: The information contained in this message and any attachment to it is
privileged, confidential and protected from disclosure. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited. If you have received this
communication in error, please notify the sender immediately by replying to
the message, and please delete it from your system. Thank you. NYSE
Euronext. 

  _  

Please consider the environment before printing this email.

Visit our website at http://www.nyse.com

Re: Log4net ADONetAppender

2013-08-13 Thread Dominik Psenner
Hi

The message indicates that something cannot be instantiated. Maybe you have
misspelled some class name or you have forgot to copy over a library?

Cheers


2013/8/13 Peter K pkfxtranspare...@gmail.com

 Hello,

 I recently migrated an application to a new server (Windows 2008 Server
 R2, SQL Server 2008 R2, Poweshell) and everything works except I get an
 error when trying to log to the database.

 log4net:ERROR XmlHierarchyConfigurator: Could not create Appender 
 [ADONetAppender] of type [log4net.Appender.ADONetAppender]. Reported error 
 follows.

 System.ArgumentNullException: CreateConverterInstance cannot create instance, 
 converterType is null

 Parameter name: converterType

at 
 log4net.Util.TypeConverters.ConverterRegistry.CreateConverterInstance(Type 
 converterType)

at 
 log4net.Util.TypeConverters.ConverterRegistry.GetConverterFromAttribute(Type 
 destinationType)

at log4net.Util.TypeConverters.ConverterRegistry.GetConvertFrom(Type 
 destinationType)

at log4net.Util.OptionConverter.CanConvertTypeTo(Type sourceType, Type 
 targetType)

at 
 log4net.Repository.Hierarchy.XmlHierarchyConfigurator.CreateObjectFromXml(XmlElement
  element, Type defaultTargetType, Type typeConstraint)

at 
 log4net.Repository.Hierarchy.XmlHierarchyConfigurator.SetParameter(XmlElement 
 element, Object target)

at 
 log4net.Repository.Hierarchy.XmlHierarchyConfigurator.CreateObjectFromXml(XmlElement
  element, Type defaultTargetType, Type typeConstraint)

at 
 log4net.Repository.Hierarchy.XmlHierarchyConfigurator.SetParameter(XmlElement 
 element, Object target)

at 
 log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseAppender(XmlElement
  appenderElement)

 log4net:ERROR XmlHierarchyConfigurator: Appender named [ADONetAppender]
 not found.

 Any help or suggestions would be greatly appreciated.
 I have tried Goggling for an answer but have not found anything.

 Thanks.

 Peter




-- 
Dominik Psenner
## OpenPGP Key Signature #
# Key ID: B469318C   #
# Fingerprint: 558641995F7EC2D251354C3A49C7E3D1B469318C  #
##


AW: Log4net ADONetAppender

2013-08-14 Thread Dominik Psenner
Hard to tell. It should be some type (i.e. class) that is mentioned in the
log4net configuration (XML) within an appender.

 

Von: Peter K [mailto:pkfxtranspare...@gmail.com] 
Gesendet: Dienstag, 13. August 2013 22:33
An: Log4NET User
Betreff: Re: Log4net ADONetAppender

 

Thanks for the response.

It is much appreciated.

I went and checked and I did not have all of the same Powershell modules
migrated to the new server.

I migrated them over and still get the same error.

 

What types of library should I be checking that I have migrated over?

Thanks again for your help.

 

Peter

 

On Tue, Aug 13, 2013 at 2:45 PM, Dominik Psenner dpsen...@gmail.com
mailto:dpsen...@gmail.com  wrote:

Hi

 

The message indicates that something cannot be instantiated. Maybe you have
misspelled some class name or you have forgot to copy over a library?

 

Cheers

 

2013/8/13 Peter K pkfxtranspare...@gmail.com
mailto:pkfxtranspare...@gmail.com 

Hello,

 

I recently migrated an application to a new server (Windows 2008 Server R2,
SQL Server 2008 R2, Poweshell) and everything works except I get an error
when trying to log to the database.

 

log4net:ERROR XmlHierarchyConfigurator: Could not create Appender
[ADONetAppender] of type [log4net.Appender.ADONetAppender]. Reported error
follows.
System.ArgumentNullException: CreateConverterInstance cannot create
instance, converterType is null
 
Parameter name: converterType
   at
log4net.Util.TypeConverters.ConverterRegistry.CreateConverterInstance(Type
converterType)
   at
log4net.Util.TypeConverters.ConverterRegistry.GetConverterFromAttribute(Type
destinationType)
 
   at log4net.Util.TypeConverters.ConverterRegistry.GetConvertFrom(Type
destinationType)
   at log4net.Util.OptionConverter.CanConvertTypeTo(Type sourceType, Type
targetType)
   at
log4net.Repository.Hierarchy.XmlHierarchyConfigurator.CreateObjectFromXml(Xm
lElement element, Type defaultTargetType, Type typeConstraint)
   at
log4net.Repository.Hierarchy.XmlHierarchyConfigurator.SetParameter(XmlElemen
t element, Object target)
 
   at
log4net.Repository.Hierarchy.XmlHierarchyConfigurator.CreateObjectFromXml(Xm
lElement element, Type defaultTargetType, Type typeConstraint)
 
   at
log4net.Repository.Hierarchy.XmlHierarchyConfigurator.SetParameter(XmlElemen
t element, Object target)
   at
log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseAppender(XmlEleme
nt appenderElement)

log4net:ERROR XmlHierarchyConfigurator: Appender named [ADONetAppender] not
found.

 

Any help or suggestions would be greatly appreciated.

I have tried Goggling for an answer but have not found anything.

 

Thanks.



 

Peter





 

-- 
Dominik Psenner
## OpenPGP Key Signature #
# Key ID: B469318C   #
# Fingerprint: 558641995F7EC2D251354C3A49C7E3D1B469318C  #
##

 



AW: Chainsaw

2013-08-28 Thread Dominik Psenner
Hi Todd,

 

You happen to be on the wrong list. This is the log4net mailing list.

 

Cheers

 

Von: Todd Bradley [mailto:todd.brad...@nirvanix.com] 
Gesendet: Mittwoch, 28. August 2013 15:50
An: log4net-user@logging.apache.org
Betreff: Chainsaw

 

Years ago I when I first learned Apache Logging, it was with log4j. And
later, the Chainsaw GUI app came along, which was very useful. Now I'm using
log4net, and decided that Chainsaw might be a good way to monitor my
application's logging in real time. But I was surprised to see that the most
recent build is from early 2006, well over 7 years ago. Am I looking in the
right place?

 

http://logging.apache.org/chainsaw/download.html

 

It seems hard to believe that Chainsaw hasn't advanced since then. It starts
up on my Windows 7 desktop, but the GUI behavior is a bit weird so far. So
I'm wondering if the app is really compatible with current Java versions. Do
any of you use Chainsaw with log4net, and - if so - is this the correct
build for me to use?

 

 

Thanks,

Todd.



AW: Thread Safety in Log

2013-09-06 Thread Dominik Psenner
At this point I usually quote Hector Correa:

 

 http://hectorcorrea.com/blog/log4net-thread-safe-but-not-process-safe
http://hectorcorrea.com/blog/log4net-thread-safe-but-not-process-safe

 

You can verify that log4net is indeed thread safe with a 3 liner console
application. However,  most people confuse thread safety with process
safety. log4net is – like many other programs - not process safe and that
has been written down in the FAQ several years ago:

 

 http://logging.apache.org/log4net/release/faq.html#single-file
http://logging.apache.org/log4net/release/faq.html#single-file

 

If log4net does not what you want it to do, then you’re probably using it in
a way it was not intended to be used.

 

Von: Rafael Thome Guimaraes [mailto:p-rguimar...@bvmf.com.br] 
Gesendet: Freitag, 6. September 2013 00:52
An: Bill Sorensen; Log4NET User
Betreff: RE: Thread Safety in Log

 

Hi Bill!

 

Thanks for your answer!

 

My case is exactly the one of the l4ndash link you passed. I am using
“RollingFileAppender” through the ILog interface.

 

“

[…]

 

//Class field

private static ILog log =
LogManager.GetLogger(typeof(RSFNMessageBatchService));

 

[…]

 

//In the class constructor

log4net.GlobalContext.Properties[LogName] =
AppSettings.GetValue(logFileName);

log4net.Config.XmlConfigurator.ConfigureAndWatch(new
System.IO.FileInfo(AppSettings.GetValue(log4NetConfigFile)));

log.Logger.Repository.Configured = true;

 

[…]

 

//Log call

log.Debug(mensagemLog);

 

[…]

 

”

 

In another file I just got, The trimmed message and the trimming message
came from the same thread! That eliminates the Thread Safety hypothesis.

 

Any ideas?

 

Thanks,

Rafael Thomé Guimarães

Analista-Programador

DO-CBCN / DI-CRAD - MIDDLEWARE

' +55 11 2565-7006

* p-rguimar...@bvmf.com.br mailto:p-bpedr...@bvmf.com.br 



 

www.bmfbovespa.com.br http://www.bmfbovespa.com.br/ 

 

 

Evite imprimir. Colabore com o Meio Ambiente!

 

 

 

From: Bill Sorensen [mailto:bsoren...@idtdna.com] 
Sent: quinta-feira, 5 de setembro de 2013 19:16
To: Rafael Thome Guimaraes; Log4NET User
Subject: RE: Thread Safety in Log

 

One of our developers (Eric Borman) researched this recently, so I’ll quote
him:

 

The short answer is that log4net is thread safe, the appenders are not.
log4net takes this into account and ensures proper serialization of logging
events. So as long as you use the logging API and don’t access the appender
directly you are safe.

 

http://stackoverflow.com/questions/1519211/multithread-safe-logging

http://www.l4ndash.com/Log4NetMailArchive%2Ftabid%2F70%2Fforumid%2F1%2Fposti
d%2F17279%2Fview%2Ftopic%2FDefault.aspx

 

However,

That does not make them process safe. So using a web garden will cause
collisions. 

 

http://hectorcorrea.com/blog/log4net-thread-safe-but-not-process-safe

 

Thanks,

_

Bill Sorensen

Patterns, Platforms and Practices

Integrated DNA Technologies

www.idtdna.com http://www.idtdna.com 

 

From: Rafael Thome Guimaraes [mailto:p-rguimar...@bvmf.com.br] 
Sent: Thursday, September 05, 2013 3:49 PM
To: Log4NET User
Subject: Thread Safety in Log

 

Hi all!

 

Anyone knows if Log4Net is Thread Safe or I need to put locks in the calls?

 

Tks,

Rafael Thomé Guimarães

 

  _  


Esta mensagem pode conter informação confidencial e/ou privilegiada. Se você
não for o destinatário ou a pessoa autorizada a receber esta mensagem, não
deverá utilizar, copiar, alterar, divulgar a informação nela contida ou
tomar qualquer ação baseada nessas informações. Se você recebeu esta
mensagem por engano, por favor avise imediatamente o remetente, respondendo
o e-mail e em seguida apague-o. Agradecemos sua cooperação.

This message may contain confidential and/or privileged information. If you
are not the addressee or authorized to receive this for the addressee, you
must not use, copy, disclose, change, take any action based on this message
or any information herein. If you have received this message in error,
please advise the sender immediately by reply e-mail and delete this
message. Thank you for your cooperation.

image001.gifimage002.gif

AW: What does the MemoryAppender's Fix() method do?

2013-09-30 Thread Dominik Psenner
http://logging.apache.org/log4net/release/sdk/log4net.Core.FixFlags.html

 

I think this is what you're looking for, isn't it?

 

Von: Rob Richardson [mailto:rdrichard...@rad-con.com] 
Gesendet: Montag, 30. September 2013 15:05
An: Log4NET User
Betreff: What does the MemoryAppender's Fix() method do?

 

The documentation for the MemoryAppender class mentions a Fix method and a
FixFlags property, but there is absolutely no information about what they
actually do.  Could someone please explain them?

 

Thank you.

 

RobR 



AW: What does the MemoryAppender's Fix() method do?

2013-09-30 Thread Dominik Psenner
Because the FixVolatileData method is now protected and invoked in the
setter of the Fix property.

 

I am wondering why you're so interested in the core internals of log4net?
This goes far beyond a simple question about how to use log4net. :)

Von: Rob Richardson [mailto:rdrichard...@rad-con.com] 
Gesendet: Montag, 30. September 2013 16:37
An: Log4NET User
Betreff: RE: What does the MemoryAppender's Fix() method do?

 

Thank you very much.  I understand now.  But I note that in the link below,
it says that FixVolatileData() is now considered obsolete.  Why is that?

 

From: Dominik Psenner [mailto:dpsen...@gmail.com] 
Sent: Monday, September 30, 2013 10:05 AM
To: 'Log4NET User'
Subject: AW: What does the MemoryAppender's Fix() method do?

 

Because we are caching the LoggingEvent beyond the lifetime of the Append()
method we volatile data in the logging event must be fixed. Otherwise they
would no longer be available for later use. That is documented further here:

 

 
http://logging.apache.org/log4net/release/sdk/log4net.Core.LoggingEvent.Fix
VolatileData_overload_1.html
http://logging.apache.org/log4net/release/sdk/log4net.Core.LoggingEvent.FixV
olatileData_overload_1.html

Sorry for being incomplete in the first message. :)



AW: log4net rolling file appender losing log files during roll over

2014-01-14 Thread Dominik Psenner
Good morning,

 

I've looked at the logfile [2] and all starts with the .log file not being
rolled cause the file is still open and thus can't be moved. The following
warnings are caused by the first error. So this is where the trouble starts:

 

log4net: Moving [c:\logs\mobile_deposit_web.log.5] -
[c:\logs\mobile_deposit_web.log.6]

log4net: Moving [c:\logs\mobile_deposit_web.log.4] -
[c:\logs\mobile_deposit_web.log.5]

log4net: Moving [c:\logs\mobile_deposit_web.log.3] -
[c:\logs\mobile_deposit_web.log.4]

log4net: Moving [c:\logs\mobile_deposit_web.log.2] -
[c:\logs\mobile_deposit_web.log.3]

log4net: Moving [c:\logs\mobile_deposit_web.log.1] -
[c:\logs\mobile_deposit_web.log.2]

log4net: Moving [c:\logs\mobile_deposit_web.log] -
[c:\logs\mobile_deposit_web.log.1]

log4net:ERROR [RollingFileAppender] ErrorCode: GenericFailure. Exception
while rolling file [c:\logs\mobile_deposit_web.log] -
[c:\logs\mobile_deposit_web.log.1]

System.IO.IOException: The process cannot access the file because it is
being used by another process.

   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)

   at System.IO.__Error.WinIOError()

   at System.IO.File.Move(String sourceFileName, String destFileName)

   at log4net.Appender.RollingFileAppender.RollFile(String fromFile, String
toFile)

log4net:ERROR RollingFileAppender: INTERNAL ERROR. Append is False but
OutputFile [c:\logs\mobile_deposit_web.log] already exists.

log4net: Opening file for writing [c:\logs\mobile_deposit_web.log] append
[False]

log4net: rolling over count [104857887]

log4net: maxSizeRollBackups [100]

log4net: curSizeRollBackups [8]

log4net: countDirection [-1]

 

My first guess is that there are multiple processes logging into the same
file. That would mean that one process may holds a write lock on the file
while another one tries to roll the file. We have seen that people often are
not aware of the IIS app domain pool and its impact on the appender
configuration. If I'm right, then your usecase hints that there are probably
three ways to resolve the issue:

 

* Use the InterProcessLock on the rolling file appender

o   this might produce a bottleneck for your high performance demands

* Use remote appenders that sink log events to a remote process that
appends the events to the file

o   This might be a nice try

* Replace the rolling file appender with an appender that sinks
events into a database or another storage that handles the write locks

o   Probably easier to configure than the remote appenders but the logs are
no longer stored as plain text in a file

 

Cheers,

D.

 

Von: Douglas Neary [mailto:dne...@miteksystems.com] 
Gesendet: Dienstag, 14. Januar 2014 23:37
An: Log4NET User
Betreff: log4net rolling file appender losing log files during roll over

 

All:

 

Under heavy strain, I am seeing log4net lose log files during roll over.   I
filed a bug yesterday (https://issues.apache.org/jira/browse/LOG4NET-416),
and I wanted to offer my help (and hardware) to help track it down.  I
attached the internal log4net log to the ticket.

 

The hardware we are using is pretty high end
(http://www8.hp.com/us/en/products/proliant-servers/product-detail.html?oid=
4231377#!tab=features).We are using this beast as a combined image
processor and web server, running IIS 7.5 on Windows Server 2008 R2.  

 

For every transaction processed, a line is written to log4net.   On average,
we are probably doing around 7 transactions per second.  This works fine for
a while, until it doesn't.   Then it starts losing log files during
rollover.

 

Given all the value we have gotten out of log4net, my company is willing to
donate some of my time and some time on that DL980 to test out the fixes.

 

Is there anyone who can give me a push in the right direction?

 

Thanks,
Doug



AW: log4net rolling file appender losing log files during roll over

2014-01-17 Thread Dominik Psenner
It would be worth checking if your assumption is true by logging the process
id and the thread name (pattern layouts %processid and %thread).

 

Cheers

 

Von: Douglas Neary [mailto:dne...@miteksystems.com] 
Gesendet: Donnerstag, 16. Januar 2014 23:24
An: Log4NET User
Betreff: RE: log4net rolling file appender losing log files during roll over

 

Hi Dominik:

 

Thanks for the reply.  

 

 I've looked at the logfile [2] and all starts with the .log file not
being rolled cause the file is still open and thus can't be moved. The
following warnings are caused by the first error. So this is where the
trouble starts:

 

Agreed.  

 

 My first guess is that there are multiple processes logging into the same
file.

 

I don't believe that is the case.Let me explain further.

 

This is an Asp.net application (.Net 3.5.1) with 3 separate web sites
logging to 3 separate log files using the rolling file appender.   

To be more specific, see the table below:

 


Folder

Log File Name

App Pool


c:\inetpub\wwwroot\mobiledeposit

C:\logs\mobile_deposit_web.log

DefaultAppPool


C:\inetpub\wwwroot\remotecarlar

C:\logs\mobile_deposit_remotecarlar.log

Remote_CarLar


C:\inetpub\wwwroot\remote_RE

C:\logs\mobile_deposit_remoteRE.log

Remote_RE

 

Since each of these 3 sites is running in a separate App Pool, they are each
running in a separate (32 bit) w3wp.exe.  There are 3 workers, each named
w3wp.exe with different PIDs.  .  I added a screen shot from Process
Explorer to the Jira ticket to show you what I mean.

 

App Domain Recycling has been disabled for each of these sites (I added
another screen shot to Jira).  The Jira url for this issue is
https://issues.apache.org/jira/browse/LOG4NET-416.

 

So my questions:

1.  Am I doing anything obviously wrong? 

2. Assuming the answer to #1 is wrong, how can I help further?

 

Thanks,

Doug

 

 

p.s.  I chopped off the rest of this email, please let me know if that was a
bad idea.



Re: log4net filling memory in prod

2014-01-30 Thread Dominik Psenner
Async appenders can be configured lossy, by the means that they will loose
events once their buffer is full:

http://logging.apache.org/log4net/release/sdk/log4net.Appender.BufferingAppenderSkeleton.Lossy.html


2014-01-29 Edward Williams (Icertis Inc) v-e...@microsoft.com:

  Please excuse my typos.  Nearly cut off my hand in November, still
 trying to type/work with it.  J  Corrected below.



 *From:* Edward Williams (Icertis Inc) [mailto:v-e...@microsoft.com]
 *Sent:* Wednesday, January 29, 2014 11:30 AM
 *To:* log4net-user@logging.apache.org
 *Subject:* log4net filling memory in prod



 Is there a way using log4net to limit the memory usage for logs?  The
 thread and private byte *count* goes out the window.  Also if trying to
 log to a path that the system doesn't have rights *to* it holds onto the
 events.  Is there a setting for simply dropping log entries that can't be
 saved?



 Thank you!




-- 
Dominik Psenner


AW: AW: how to keep 3 days of logs

2014-02-18 Thread Dominik Psenner
I think that what he is searching for is the combination of MaxBackupIndex=3
and rolling style Once. Rolling by date won't work with the backup index
detection mechanisms.

 

Von: George Mauer [mailto:gma...@gmail.com] 
Gesendet: Dienstag, 18. Februar 2014 16:19
An: Log4NET User
Betreff: Re: AW: how to keep 3 days of logs

 

I believe that is the point of the maxBackupIndex setting
http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/RollingFileApp
ender.html#setMaxBackupIndex(int)  on RollingFileAppender. I'm not 100%
sure what the xml for it is as I always roll based on file size but it
shouldn't be too hard to google or guess.

 

On Tue, Feb 18, 2014 at 8:56 AM, moonstone acedog032...@yahoo.com
mailto:acedog032...@yahoo.com  wrote:

Thanks for your reply.  I was not clear in stating my goal.  The application
runs once per day.  With the log4net configuration that I have currently, I
get 1 log file each day with the date in the file name.  The number of log
files increases by one each day.  A user has to delete old log files by
sorting on the file date and deleting the oldest ones.  The customer only
wants to keep the log files from the last 3 runs of the application.  I can
write the code to delete the old files, but I thought I should check if
log4net can do it.

My configuration is shown below:

appender name=RollingLogFileAppender
type=log4net.Appender.RollingFileAppender


datePattern value='.'-MM-dd'.txt' /





layout type=log4net.Layout.PatternLayout



/layout
/appender




--

View this message in context:
http://apache-logging.6191.n7.nabble.com/how-to-keep-3-days-of-logs-tp44594p
44630.html

Sent from the Log4net - Users mailing list archive at Nabble.com.

 



[ANNOUNCEMENT] Welcome Matt Sicker

2014-03-02 Thread Dominik Psenner
Hi,

 

it is my pleasure to announce to the community

that Matt Sicker has joined our ranks.

 

He made remarkable contributions to LOG4J

and we all believe he is a valuable member

of Apache Logging Services now and in future.

 

Kind regards,

Dominik Psenner

 



AW: Rolling File Appender by date

2014-05-16 Thread Dominik Psenner
Hello Herrmann

 

I don't think that works right now - at least not in a way such that I would
trust it. The trouble lies in situations where the application is stopped
for an arbitrary amount of time. It might become computationally intensive
to find every file created by the logger and the chance of getting false
positives is high and thus files might get deleted that shouldn't be deleted
at all.

 

The overall consensus on this topic was (and probably is) that the rolling
file appender must be rewritten. But that's an open issue for quite a long
time now. The reason for that is probably that the current implementation of
the rolling file appender works just fine for most use cases and the missing
features were no show-stopper to anyone yet. :)

 

JMTC

Cheers

 

Von: Herrmann, David G [mailto:david.g.herrm...@intel.com] 
Gesendet: Mittwoch, 7. Mai 2014 23:32
An: 'Log4NET User'
Betreff: Rolling File Appender by date

 

I have my log4net configured to roll the file each day. Is there a way to
specify the maximum number of files to keep before they get deleted? In
other words, can I use the following when rolling based on Date:

 

maxSizeRollBackups value=10 /

 

Or is that only available when rolling the file based on size?

Thank you.

-Dave Herrmann



AW: RollingFileAppender overwriting file

2014-05-29 Thread Dominik Psenner
Multithreading shouldn't be an issue. Try this:

 

 http://stackoverflow.com/questions/2075603/log4net-process-id-information
http://stackoverflow.com/questions/2075603/log4net-process-id-information

 

Von: Tim Sirmovics [mailto:t...@axima.com.au] 
Gesendet: Donnerstag, 29. Mai 2014 00:45
An: Log4NET User
Betreff: RE: RollingFileAppender overwriting file

 

I have changed the locking model to InterProcessLock but the problem still
occurs.

I started logging the thread number and found it is consistently 1
throughout all runs of the application.

 

At this stage with no other ideas I am going to make sure the application
does not execute from 11:30 - 12:30 and see if this helps it to roll the log
over correctly.

 

From: Dominik Psenner [mailto:dpsen...@gmail.com] 
Sent: Tuesday, 27 May 2014 04:24 PM
To: 'Log4NET User'
Subject: AW: RollingFileAppender overwriting file

 

Just to be sure, use an InterProcessLock in your configuration and check if
this happens again. You might also want to include process information in
the log messages.

 

Von: Tim Sirmovics [mailto:t...@axima.com.au] 
Gesendet: Dienstag, 27. Mai 2014 02:49
An: log4net-user@logging.apache.org mailto:log4net-user@logging.apache.org

Betreff: FW: RollingFileAppender overwriting file

 

I have been using the RollingFileAppender through numerous log4net version
for about 3-4 years.

In the last few days I am now experiencing the following issue:

 

1.   Assume today is 27/05/2014

2.   Current log file is called Debug.log

3.   Log file builds up throughout the day.

4.   Next day (28/05/2014), log file Debug.log.27.log exists, last write
time according to windows is 27/05/2014 11:59 pm

5.   Open log file, all entries from 27/05 are gone, log only contains a
very small number of entries dated 28/05/2014 just after midnight.

 

I am now losing my logs for each day as they are being overwritten by the
first few logs after midnight.

Only one process writes to this file.

The process is limited to only running a single instance at a time.

I have not changed my configuration for a long time, however I have included
it below.

 

 

!-- Last month, one file per day --

  appender name=DebugRollingFileAppender
type=log4net.Appender.RollingFileAppender

file value=Logs\Debug.log /

appendToFile value=true /

lockingModel type=log4net.Appender.FileAppender+MinimalLock /

rollingStyle value=Date /

datePattern value=.dd'.log' /

maxSizeRollBackups value=14 /

threshold value=DEBUG/

layout type=log4net.Layout.PatternLayout

  conversionPattern value=|%date| |%-5level|
|%property{log4net:HostName}| |%logger{2}|: %message%newline /

/layout

  /appender

 

 

Is there any way I can prevent this from happening?


Tim Sirmovics
IT
t...@axima.com.au mailto:t...@axima.com.au 

 
AXIMA Pty. Ltd.
135 Boundary Road, Laverton North 
Victoria 3026 Australia
T: +61 3 83685300
F: +61 3 83685333
W: www.axima.com.au http://www.axima.com.au 

This message and any files transmitted with it are confidential and are
intended solely for the use of those persons to whom the message is
addressed. If you have received this message in error, please destroy and
delete this message from your computer. Any unauthorised reproduction of
this message or any files transmitted with it is strictly prohibited. All
business is conducted pursuant to Axima's trading terms and conditions which
may exclude or limit liability in certain circumstances. 

 

---Safe Stamp---
Your Anti-virus Service scanned this email. It is safe from known viruses.
For more information regarding this service, please contact your service
provider.



ApacheCon EU call for papers

2014-05-29 Thread Dominik Psenner
Hey people,

 

this is a reminder that we're in the final weeks of the ApacheCon EU call
for paper and it will close at the end of the day of June 25th, whatever
timezone is latest. We are still looking for presentations for this event.
Check out this if you're interested:

 

http://events.linuxfoundation.org/events/apachecon-europe/program/cfp

 

Best regards.

 

Dominik



Re: RollingFileAppender overwriting file

2014-05-30 Thread Dominik Psenner
I'm bad at guessing. You could enable log4net's internal debugging and
check if something fishy shows up there.


2014-05-30 0:39 GMT+02:00 Tim Sirmovics t...@axima.com.au:

  Not letting the process run at any time around midnight seems to have
 solved the issue for now.



 The setup I have is that the process runs on a Hyper-V virtualised server,
 writing to a log file stored on a network share on a completely different
 server.

 Do you think anything related to this could cause the issue?



 *From:* Dominik Psenner [mailto:dpsen...@gmail.com]
 *Sent:* Thursday, 29 May 2014 10:01 PM

 *To:* 'Log4NET User'
 *Subject:* AW: RollingFileAppender overwriting file



 Multithreading shouldn’t be an issue. Try this:



 http://stackoverflow.com/questions/2075603/log4net-process-id-information



 *Von:* Tim Sirmovics [mailto:t...@axima.com.au t...@axima.com.au]
 *Gesendet:* Donnerstag, 29. Mai 2014 00:45
 *An:* Log4NET User
 *Betreff:* RE: RollingFileAppender overwriting file



 I have changed the locking model to InterProcessLock but the problem
 still occurs.

 I started logging the thread number and found it is consistently “1”
 throughout all runs of the application.



 At this stage with no other ideas I am going to make sure the application
 does not execute from 11:30 – 12:30 and see if this helps it to roll the
 log over correctly.



 *From:* Dominik Psenner [mailto:dpsen...@gmail.com dpsen...@gmail.com]
 *Sent:* Tuesday, 27 May 2014 04:24 PM
 *To:* 'Log4NET User'
 *Subject:* AW: RollingFileAppender overwriting file



 Just to be sure, use an InterProcessLock in your configuration and check
 if this happens again. You might also want to include process information
 in the log messages.



 *Von:* Tim Sirmovics [mailto:t...@axima.com.au t...@axima.com.au]
 *Gesendet:* Dienstag, 27. Mai 2014 02:49
 *An:* log4net-user@logging.apache.org
 *Betreff:* FW: RollingFileAppender overwriting file



 I have been using the RollingFileAppender through numerous log4net version
 for about 3-4 years.

 In the last few days I am now experiencing the following issue:



 1.   Assume today is 27/05/2014

 2.   Current log file is called Debug.log

 3.   Log file builds up throughout the day.

 4.   Next day (28/05/2014), log file Debug.log.27.log exists, last
 write time according to windows is 27/05/2014 11:59 pm

 5.   Open log file, all entries from 27/05 are gone, log only
 contains a very small number of entries dated 28/05/2014 just after
 midnight.



 I am now losing my logs for each day as they are being overwritten by the
 first few logs after midnight.

 Only one process writes to this file.

 The process is limited to only running a single instance at a time.

 I have not changed my configuration for a long time, however I have
 included it below.





 !-- Last month, one file per day --

   appender name=DebugRollingFileAppender type=
 log4net.Appender.RollingFileAppender

 file value=Logs\Debug.log /

 appendToFile value=true /

 lockingModel type=log4net.Appender.FileAppender+MinimalLock /

 rollingStyle value=Date /

 datePattern value=.dd'.log' /

 maxSizeRollBackups value=14 /

 threshold value=DEBUG/

 layout type=log4net.Layout.PatternLayout

   conversionPattern value=|%date| |%-5level|
 |%property{log4net:HostName}| |%logger{2}|: %message%newline /

 /layout

   /appender





 Is there any way I can prevent this from happening?


 Tim Sirmovics
 IT
 t...@axima.com.au

 [image: www.axima.com.au]
 AXIMA Pty. Ltd.
 135 Boundary Road, Laverton North
 Victoria 3026 Australia
 T: +61 3 83685300
 F: +61 3 83685333
 W: www.axima.com.au

 This message and any files transmitted with it are confidential and are
 intended solely for the use of those persons to whom the message is
 addressed. If you have received this message in error, please destroy and
 delete this message from your computer. Any unauthorised reproduction of
 this message or any files transmitted with it is strictly prohibited. All
 business is conducted pursuant to Axima's trading terms and conditions
 which may exclude or limit liability in certain circumstances.



 ---Safe
 Stamp---
 Your Anti-virus Service scanned this email. It is safe from known viruses.
 For more information regarding this service, please contact your service
 provider.

 ---Safe
 Stamp---
 Your Anti-virus Service scanned this email. It is safe from known viruses.
 For more information regarding this service, please contact your service
 provider.




-- 
Dominik Psenner


Re: AdoNetAppender not working PostgreSQL database using Npgsql

2014-05-30 Thread Dominik Psenner
Glad you were able to sort it out on your own and be sure that it would
have taken ages to find this. :-)

Cheers


2014-05-30 21:32 GMT+02:00 Rob Richardson rdrichard...@rad-con.com:

  Sorry to bother you.  The problem turns out to be what seems to me an
 unbelievable bug (feature?) in the PostgreSQL administration tool PGAdmin
 shipped with version 9.3:  if you use that tool to create a table, the name
 of the table includes double quotes.



 I decided, just for grins, to try the insert statement I specified in my
 configuration file:

 INSERT INTO Log (message) VALUES ('This is a log message')

 It didn’t work!

 Neither did:

 INSERT INTO log (message) VALUES ('This is a log message')

 But this worked:

 INSERT INTO “Log” (message) VALUES ('This is a log message')



 But I don’t know how to include double quotes inside an XML attribute.
 So, I deleted the table and recreated it manually, making sure not to use
 double-quotes around the identifiers.  Once I did that, I got the log
 messages in the table as expected.



 RobR




-- 
Dominik Psenner


AW: set buffersize conditionally?

2014-06-12 Thread Dominik Psenner
Good morning

 

You can tell log4net to flush the buffer on specific events (see Evaluator 
property in the class log4net.Appender.BufferingAppenderSkeleton). However, you 
can have exactly one buffer size for each buffering appender because every 
appender has exactly one buffer. You could configure multiple appenders for 
every domain you have and thus every domain can have its own buffer size.

 

Changing the buffer size at runtime sounds dangerous to me and therefore I 
discourage you to try that, but if you know what you are doing take a look at 
http://stackoverflow.com/questions/2458227/why-isnt-my-log4net-appender-buffering
 and remember to call ActivateOptions() after changing the BufferSize.

 

Cheers

 

Von: d_k [mailto:mail...@gmail.com] 
Gesendet: Donnerstag, 12. Juni 2014 06:25
An: Log4NET User
Betreff: Re: set buffersize conditionally?

 

Well, you can have a different configuration file for each application and set 
their values accordingly.

 

On Thu, Jun 12, 2014 at 6:59 AM, tirath.g tirat...@hotmail.com 
mailto:tirat...@hotmail.com  wrote:

hi,

is it possible to set buffersize conditionally. i am trying to use log4net
for entire orgnaziation solution and writing info to a database table. can i
set different values of buffer size programically depending on some
condition( like request coming from application 1 to use buffer size = 100
others to use 1). thankyou.



--
View this message in context: 
http://apache-logging.6191.n7.nabble.com/set-buffersize-conditionally-tp48117.html
Sent from the Log4net - Users mailing list archive at Nabble.com.

 



Re: Log4net.ThreadContext.Properties Having stale data. How to resolve it?

2014-07-24 Thread Dominik Psenner
Hi Ananth Tatachar,

I'm having a hard time understanding your problem. Can you provide us a
sample application including all the code together with both a broken
sample output and a expected sample output? It would also be interesting
which exact version of log4net you are using.

Best regards



2014-07-24 2:31 GMT+02:00 Ananth Tatachar ananth.tatac...@gmail.com:



 -- Forwarded message --
 From: Ananth Tatachar ananth.tatac...@gmail.com
 Date: Wed, Jul 23, 2014 at 8:24 PM
 Subject: Log4net.ThreadContext.Properties Having stale data. How to
 resolve it?
 To: log4net-user@logging.apache.org


 I am using a RollingFileAppender , and my own custom layout. My
 application is multithreaded. Each thread will generate unique random data
 and is supposed to log it using log4net framework. However if I create
 multiple threads in quick succession I notice stale data in my logs , this
 goes away if each thread sleeps for 50 ms before logging. I am not able to
 figure out a solution to this issue or find its cause please do help me.

 My logging function looks like this:


 log4net.ThreadContext.properties[randomGeneratedData] =
 randomGeneratedData;
 private ILog myLog =
LogManager.GetLogger(typeof(LogTest));
 using (log4net.NDC.Push(ndcTest1))
 {
 using (log4net.NDC.Push(ndcTest2))
 {
 myLog.Info(myLogTest);
 }
 }





 Result of logging:

 NDC = ndcTest1 ndcTest2 , randomGeneratedData = rad1
NDC = ndcTest1 ndcTest2 , randomGeneratedData = rad2
NDC = , randomGeneratedData = rad2

 and so on ...


 I tried to clear log4net.ThreadContext.Properties before filling it again
 , but it was of no use. Please help.




-- 
Dominik Psenner


Re: Log4net.ThreadContext.Properties Having stale data. How to resolve it?

2014-07-25 Thread Dominik Psenner
I am glad you were able to sort this out. To answer that last question it
might be best to dig into the log4net source by yourself. It is not
complicated after all.

Best regards

On 25 Jul 2014 02:55, Ananth Tatachar ananth.tatac...@gmail.com wrote:

 Hi Dominik I solved my issue. There was a delegate statement which was
causing all the trouble.
 However I still dont understand the need of LoggingEventData and why all
the properties in my loggingEvent object are null before calling
loggingEvent.GetLoggingEventData(); I'll be grateful if you could help me
with this.
 Thanks a lot..


 On Thu, Jul 24, 2014 at 10:38 AM, Ananth Tatachar 
ananth.tatac...@gmail.com wrote:

 Sorry I forgot to mention : My application is multithreaded and the
log4net version = 1.2.12


 On Thu, Jul 24, 2014 at 10:32 AM, Ananth Tatachar 
ananth.tatac...@gmail.com wrote:

 Hi Dominik Psenner ,

 Thanks a lot for replying , I am really sorry about my bad explanation
of my problem.

 I am trying to create a custom Json Layout ,


--
 1) The custom layout class:


  class MyJsonLayout:LayoutSkeleton
 {
 private HashSetString IncludeFieldsList { get; set; }

 public override void ActivateOptions()
 {

 }

 public override void Format(TextWriter writer, LoggingEvent
loggingEvent)
 {
 if(writer == null || loggingEvent == null)
 {
 throw new ArgumentNullException();
 }
 var myJsonObj = new MyJsonObject(loggingEvent,
IncludeFieldsList );
 var json =
JsonConvert.SerializeObject(myJsonObj,Formatting.None);
 writer.WriteLine(json);
 }
 }


---

 2) The MyJsonObject class:

 [JsonObject(MemberSerialization.OptIn)]
 class MyJsonObject
 {
 [JsonProperty(@timestamp)]
 private DateTime TimeStamp { get; set; }

 [JsonProperty(@message, NullValueHandling =
NullValueHandling.Ignore)]
 private String Message { get; set; }

 [JsonProperty(@tid, NullValueHandling =
NullValueHandling.Ignore)]
 private String Tid {get;set;}

 [JsonObject(MemberSerialization.OptIn)]
 private String MyGuid {get;set;}

public MyJsonObject(LoggingEvent loggingEvent)
{
 var lgData = loggingEvent.GetLoggingEventData(); // For
some reason if I dont do this , all the loggingEvent.Properties are null. I
did not understand this.
 TimeStamp = loggingEvent.TimeStamp;
 MyGuid = loggingEvent.Properties[myguid];
 //loggingEvent.Properties.Remove(myguid); I tried doing
this , but nothing changed in my output.
 Message = loggingEvent.Properties[message];
 Tid = loggingEvent.Properties[tid];
}

 }




 3) The Place where I put data into log4net.ThreadContext.Properties:

 class MyInstatntiationClass
 {
 log4net.ThreadContext.Properties[myguid] =
Guid.NewGuid().ToString();
 log4net.ThreadContext.Properties[tid]
= System.Threading.Thread.CurrentThread.ManagedThreadId.ToString();
 }



-

 4) My Web.config file:



 appender name=RollingLocalFileAppender
type=log4net.Appender.RollingFileAppender
   file type=log4net.Util.PatternString value=C:\Logs\JSON.log
/
   rollingStyle value=Date /
   datePattern value=-MM-dd /
   maxSizeRollBackups value=10 /
   appendToFile value=true /
   layout type=MyJsonLayout, Version=1.0.0.0, Culture=neutral
   /layout
 /appender





 5) Output file:


 {@timestamp:2014-07-24T10:20:32.1223183-04:00
,@tid:5,@myguid:dfg134xcd_dfe-123uier00}

{@timestamp:2014-07-24T10:20:32.3213382-04:00,@tid:5,@myguid:dfg134xcd_dfe-123uier00}

{@timestamp:2014-07-24T10:20:32.8273888-04:00,@tid:5,@myguid:dfg134xcd_dfe-123uier00}

{@timestamp:2014-07-24T10:20:32.8273888-04:00,@tid:6,@myguid:fgsg4678xzv-adfry-2356i}


 Expected behaviour:

 Each of my calls should result in unique guids. But as you can see I am
getting

Re: Section or group name 'log4net' is already defined

2014-08-08 Thread Dominik Psenner
Hi Vanitha,

I would guess that it makes no sense having two log4net configuration
sections for one application as that implies some confusion which
configuration might be the one to be used. What is the other error?

Best regards


2014-08-07 18:43 GMT+02:00 Venkatasamy, Vanitha 
vanitha.venkatas...@xpandcorp.com:

  I have a parent and child application. Log4net has been declared in both
 the web.config’s



 Suddenly I started getting this below error in child application.



 Exception information:

 Exception type: ConfigurationErrorsException

 Exception message: Section or group name 'log4net' is already defined.
 Updates to this may only occur at the configuration level where it is
 defined. (\web.config line 5)





 If I remove the section from child web.config, some other error .



 Any suggestion to look for



 Thanks,

 Vanitha Venkatasamy

 XPAND Corporation.

 [image: contact_email]






  This message contains Devin Group confidential information and is
 intended only for the individual named. If you are not the named addressee
 you should not disseminate, distribute or copy this e-mail. Please notify
 the sender immediately by e-mail if you have received this e-mail in error
 and delete this e-mail from your system. E-mail transmissions cannot be
 guaranteed secure, error-free and information could be intercepted,
 corrupted, lost, destroyed, arrive late, incomplete, or contain viruses.
 The sender therefore does not accept liability for errors or omissions in
 the contents of this message which may arise as result of transmission. If
 verification is required please request hard-copy version




-- 
Dominik Psenner


AW: Dynamically change log levels confined to ThreadContext

2015-02-12 Thread Dominik Psenner
Hi Christopher,

 

I believe that you would have to create your own level evaluator
implementation. Basically you implement the interface log4net.Filter.IFilter
or, to make the interaction with the filter chain less painful, you extend
log4net.Filter.FilterSkeleton. There you can override the method
Decice(LoggingEvent) and fit it to your needs. Last but not least you will
then configure log4net to set up your filter in the configuration and you
can do that just like one would reference a custom appender
(http://logging.apache.org/log4net/release/faq.html#custom-appender).

 

Best regards,

Dominik

 

Von: Christopher Landry [mailto:clan...@igloosoftware.com] 
Gesendet: Donnerstag, 12. Februar 2015 21:01
An: log4net-user@logging.apache.org
Betreff: Dynamically change log levels confined to ThreadContext

 

I have a web app, and I'm trying to allow users to set the logging level via
a query parameter. Got this working pretty easily.

 

The issue is that it doesn't just change the logging level for that request,
it's changed for all requests that come in during the life cycle of that
request - since I'm setting it back to the default level when the request is
resolved.

 

I have tried adding the following in my appender, but it's not working as I
hoped.

 

evaluator type=log4net.spi.LevelEvaluator

 threshold

   layout type=log4net.Layout.RawPropertyLayout

key value=LogLevel /

 /threshold

/evaluator

 

And set a ThreadContext property called LogLevel to the appropriate level,
but that doesn't seem to work either.

 

Any thoughts? Have I missed something obvious?

 

Thanks!



AW: [External] AW: Log4Net RollingFileAppender not adding Custom property in Win8/VS2013

2015-01-08 Thread Dominik Psenner
Great to hear that you’ve got sorted it out! Would you like to share more
details on the problems and how you solved them? This information might
become handy to future readers who run into a similar issue.

 

Cheers

 

Von: Goyal, Nitin UTAS [mailto:nitin.go...@utas.utc.com] 
Gesendet: Donnerstag, 08. Jänner 2015 11:45
An: Log4NET User
Betreff: RE: [External] AW: Log4Net RollingFileAppender not adding Custom
property in Win8/VS2013

 

Thanks mate for the insight.

 

I got it solved by looking at the log files of the log4net and the issue was
in the naming and some regional setting of the machine with Win8.

 

Regards

Nitin

 

From: Dominik Psenner [mailto:dpsen...@gmail.com] 
Sent: 07 January 2015 18:44
To: 'Log4NET User'
Subject: AW: [External] AW: Log4Net RollingFileAppender not adding Custom
property in Win8/VS2013

 

Given that you’ve already enabled and checked log4net’s internal debug logs,
would you mind sharing these logs with us? The next best bet I can come up
with is that you step through the application with the debugger right from
the point where you set up the property and invoke
log4net.Config.XmlConfigurator.Configure(). You could even step through a
second instance that runs on win7 at the same time. This way you would
literally see where the instances branch.

 

Cheers

 

Von: Goyal, Nitin UTAS [mailto:nitin.go...@utas.utc.com] 
Gesendet: Mittwoch, 07. Jänner 2015 13:57
An: Log4NET User
Cc: nitinkumgo...@gmail.com mailto:nitinkumgo...@gmail.com 
Betreff: RE: [External] AW: Log4Net RollingFileAppender not adding Custom
property in Win8/VS2013

 

Thanks

 

I have checked all this stuff and this all working in Win7 perfectly.

 

The only issue is when I try to run the same code on Win8 with VS2013 and it
don’t use that property and create alone the file name as the datetime and
not the static value I have added. It’s very surprising and I am banging my
head what changes are doing this to happen. :/

 

Regards
Nitin

 

From: Dominik Psenner [mailto:dpsen...@gmail.com] 
Sent: 07 January 2015 17:36
To: 'Log4NET User'
Cc: nitinkumgo...@gmail.com mailto:nitinkumgo...@gmail.com 
Subject: [External] AW: Log4Net RollingFileAppender not adding Custom
property in Win8/VS2013

 

Howdie,

 

Here’s a list of things that you could check:

 

* First of all enable log4net’s internal debug logging, it may give
you a clue what he is doing

* Make sure to call log4net.Config.XmlConfigurator.Configure() after
setting the property

* Escape path separators properly

* Specify the rolling style to be used

 

Beware that using a patternstring for  the file property of a
rollingfileappender is a hot hack and you might get burned as soon as
rolling jumps in!

 

Cheers

 

Von: Goyal, Nitin UTAS [mailto:nitin.go...@utas.utc.com] 
Gesendet: Mittwoch, 07. Jänner 2015 11:23
An: log4net-user@logging.apache.org mailto:log4net-user@logging.apache.org

Cc: nitinkumgo...@gmail.com mailto:nitinkumgo...@gmail.com 
Betreff: Log4Net RollingFileAppender not adding Custom property in
Win8/VS2013

 

Hi All

I am creating a custom property in Log4Net with Visual Studio 2010 on Win7
and it is able to create everything well with the correct property. But If i
try to run the same program on Win8 and Visual Studio 2013, it do create the
log file but without the custom property.

I have not edited anything and same thing is working in WIn7 but not in
Win8. 

I don't know what is changing in both of these environments. Can anyone give
hint at what to look for?

?xml version=1.0 encoding=utf-8 ?

configuration

  configSections

section name=log4net
type=log4net.Config.Log4NetConfigurationSectionHandler,log4net /

  /configSections

  log4net

  appender name=CsvFileAppender
type=log4net.Appender.RollingFileAppender,log4net

file type=log4net.Util.PatternString
value=C:\TSAS_DRU_Log\%property{LogName} /

appendToFile value=true/

maxSizeRollBackups value=10/

maximumFileSize value=100MB/

staticLogFileName value=true/

layout type=TSAS_DRU_app.CsvPatternLayout, TSAS_DRU_app

/layout

  /appender

  root

level value=DEBUG /

appender-ref ref=CsvFileAppender /

  /root

/log4net

  /configuration

 

I am setting the property in the code as following which is working
correctly in WIn7 but not in Win8 where I have just updated the Visual
studio as version 2013 with 2010:

string LogName = TSAS_DRU_Log_ + date + .csv;

log4net.GlobalContext.Properties[LogName] = LogName;

 

 

Nitin Goyal – Technical Lead, Software – Sensors  Integrated Systems

UTC AEROSPACE SYSTEMS

Netra Tech Park, Old Plot No.181, New Plot No. 40, EPIP Industrial Area,
Part of Sy.No.28, Kundalahalli Village, Krishnaraja Puram Hobli, Bangalore
560 066, Karnataka, India

Tel: +91 80 673 80262  Mobile: +91 9886295724  Fax: +91 80 673 80005

nitin.go...@utas.utc.com mailto:naveen.hiriyanna...@utas.utc.com
www.utcaerospacesystems.com http://www.utcaerospacesystems.com

AW: Log4Net RollingFileAppender not adding Custom property in Win8/VS2013

2015-01-07 Thread Dominik Psenner
Howdie,

 

Here’s a list of things that you could check:

 

* First of all enable log4net’s internal debug logging, it may give
you a clue what he is doing

* Make sure to call log4net.Config.XmlConfigurator.Configure() after
setting the property

* Escape path separators properly

* Specify the rolling style to be used

 

Beware that using a patternstring for  the file property of a
rollingfileappender is a hot hack and you might get burned as soon as
rolling jumps in!

 

Cheers

 

Von: Goyal, Nitin UTAS [mailto:nitin.go...@utas.utc.com] 
Gesendet: Mittwoch, 07. Jänner 2015 11:23
An: log4net-user@logging.apache.org
Cc: nitinkumgo...@gmail.com
Betreff: Log4Net RollingFileAppender not adding Custom property in
Win8/VS2013

 

Hi All

I am creating a custom property in Log4Net with Visual Studio 2010 on Win7
and it is able to create everything well with the correct property. But If i
try to run the same program on Win8 and Visual Studio 2013, it do create the
log file but without the custom property.

I have not edited anything and same thing is working in WIn7 but not in
Win8. 

I don't know what is changing in both of these environments. Can anyone give
hint at what to look for?

?xml version=1.0 encoding=utf-8 ?

configuration

  configSections

section name=log4net
type=log4net.Config.Log4NetConfigurationSectionHandler,log4net /

  /configSections

  log4net

  appender name=CsvFileAppender
type=log4net.Appender.RollingFileAppender,log4net

file type=log4net.Util.PatternString
value=C:\TSAS_DRU_Log\%property{LogName} /

appendToFile value=true/

maxSizeRollBackups value=10/

maximumFileSize value=100MB/

staticLogFileName value=true/

layout type=TSAS_DRU_app.CsvPatternLayout, TSAS_DRU_app

/layout

  /appender

  root

level value=DEBUG /

appender-ref ref=CsvFileAppender /

  /root

/log4net

  /configuration

 

I am setting the property in the code as following which is working
correctly in WIn7 but not in Win8 where I have just updated the Visual
studio as version 2013 with 2010:

string LogName = TSAS_DRU_Log_ + date + .csv;

log4net.GlobalContext.Properties[LogName] = LogName;

 

 

Nitin Goyal – Technical Lead, Software – Sensors  Integrated Systems

UTC AEROSPACE SYSTEMS

Netra Tech Park, Old Plot No.181, New Plot No. 40, EPIP Industrial Area,
Part of Sy.No.28, Kundalahalli Village, Krishnaraja Puram Hobli, Bangalore
560 066, Karnataka, India

Tel: +91 80 673 80262  Mobile: +91 9886295724  Fax: +91 80 673 80005

nitin.go...@utas.utc.com mailto:naveen.hiriyanna...@utas.utc.com
www.utcaerospacesystems.com http://www.utcaerospacesystems.com/ 

 

CONFIDENTIALITY WARNING:  This message may contain proprietary and/or
privileged information of UTC Aerospace Systems and its affiliated
companies.  If you are not the intended recipient, please 1) do not
disclose, copy, distribute or use this message or its contents, 2) advise
the sender by return e-mail, and 3) delete all copies (including all
attachments) from your computer.  Your cooperation is greatly appreciated.

 



AW: [External] AW: Log4Net RollingFileAppender not adding Custom property in Win8/VS2013

2015-01-07 Thread Dominik Psenner
Given that you’ve already enabled and checked log4net’s internal debug logs,
would you mind sharing these logs with us? The next best bet I can come up
with is that you step through the application with the debugger right from
the point where you set up the property and invoke
log4net.Config.XmlConfigurator.Configure(). You could even step through a
second instance that runs on win7 at the same time. This way you would
literally see where the instances branch.

 

Cheers

 

Von: Goyal, Nitin UTAS [mailto:nitin.go...@utas.utc.com] 
Gesendet: Mittwoch, 07. Jänner 2015 13:57
An: Log4NET User
Cc: nitinkumgo...@gmail.com
Betreff: RE: [External] AW: Log4Net RollingFileAppender not adding Custom
property in Win8/VS2013

 

Thanks

 

I have checked all this stuff and this all working in Win7 perfectly.

 

The only issue is when I try to run the same code on Win8 with VS2013 and it
don’t use that property and create alone the file name as the datetime and
not the static value I have added. It’s very surprising and I am banging my
head what changes are doing this to happen. :/

 

Regards
Nitin

 

From: Dominik Psenner [mailto:dpsen...@gmail.com] 
Sent: 07 January 2015 17:36
To: 'Log4NET User'
Cc: nitinkumgo...@gmail.com mailto:nitinkumgo...@gmail.com 
Subject: [External] AW: Log4Net RollingFileAppender not adding Custom
property in Win8/VS2013

 

Howdie,

 

Here’s a list of things that you could check:

 

* First of all enable log4net’s internal debug logging, it may give
you a clue what he is doing

* Make sure to call log4net.Config.XmlConfigurator.Configure() after
setting the property

* Escape path separators properly

* Specify the rolling style to be used

 

Beware that using a patternstring for  the file property of a
rollingfileappender is a hot hack and you might get burned as soon as
rolling jumps in!

 

Cheers

 

Von: Goyal, Nitin UTAS [mailto:nitin.go...@utas.utc.com] 
Gesendet: Mittwoch, 07. Jänner 2015 11:23
An: log4net-user@logging.apache.org mailto:log4net-user@logging.apache.org

Cc: nitinkumgo...@gmail.com mailto:nitinkumgo...@gmail.com 
Betreff: Log4Net RollingFileAppender not adding Custom property in
Win8/VS2013

 

Hi All

I am creating a custom property in Log4Net with Visual Studio 2010 on Win7
and it is able to create everything well with the correct property. But If i
try to run the same program on Win8 and Visual Studio 2013, it do create the
log file but without the custom property.

I have not edited anything and same thing is working in WIn7 but not in
Win8. 

I don't know what is changing in both of these environments. Can anyone give
hint at what to look for?

?xml version=1.0 encoding=utf-8 ?

configuration

  configSections

section name=log4net
type=log4net.Config.Log4NetConfigurationSectionHandler,log4net /

  /configSections

  log4net

  appender name=CsvFileAppender
type=log4net.Appender.RollingFileAppender,log4net

file type=log4net.Util.PatternString
value=C:\TSAS_DRU_Log\%property{LogName} /

appendToFile value=true/

maxSizeRollBackups value=10/

maximumFileSize value=100MB/

staticLogFileName value=true/

layout type=TSAS_DRU_app.CsvPatternLayout, TSAS_DRU_app

/layout

  /appender

  root

level value=DEBUG /

appender-ref ref=CsvFileAppender /

  /root

/log4net

  /configuration

 

I am setting the property in the code as following which is working
correctly in WIn7 but not in Win8 where I have just updated the Visual
studio as version 2013 with 2010:

string LogName = TSAS_DRU_Log_ + date + .csv;

log4net.GlobalContext.Properties[LogName] = LogName;

 

 

Nitin Goyal – Technical Lead, Software – Sensors  Integrated Systems

UTC AEROSPACE SYSTEMS

Netra Tech Park, Old Plot No.181, New Plot No. 40, EPIP Industrial Area,
Part of Sy.No.28, Kundalahalli Village, Krishnaraja Puram Hobli, Bangalore
560 066, Karnataka, India

Tel: +91 80 673 80262  Mobile: +91 9886295724  Fax: +91 80 673 80005

nitin.go...@utas.utc.com mailto:naveen.hiriyanna...@utas.utc.com
www.utcaerospacesystems.com http://www.utcaerospacesystems.com/ 

 

CONFIDENTIALITY WARNING:  This message may contain proprietary and/or
privileged information of UTC Aerospace Systems and its affiliated
companies.  If you are not the intended recipient, please 1) do not
disclose, copy, distribute or use this message or its contents, 2) advise
the sender by return e-mail, and 3) delete all copies (including all
attachments) from your computer.  Your cooperation is greatly appreciated.

 



Apache Con

2015-03-19 Thread Dominik Psenner
Dear Apache Logging enthusiast,

In just a few weeks, we'll be holding ApacheCon in Austin, Texas, and we'd
love to have you in attendance. You can save $300 on admission by
registering NOW, since the early bird price ends on the 21st.

Register at http://s.apache.org/acna2015-reg

ApacheCon this year celebrates the 20th birthday of the Apache HTTP Server,
and we'll have Brian Behlendorf, who started this whole thing, keynoting
for us, and you'll have a chance to meet some of the original Apache Group,
who will be there to celebrate with us.

We've got 7 tracks of great talks, as well as BOFs, the Apache BarCamp,
project-specific hack events, and evening events where you can deepen your
connection with the larger Apache community. See the full schedule at
http://apacheconna2015.sched.org/

And if you have any questions, comments, or just want to hang out with us
before and during the event, follow us on Twitter - @apachecon - or drop by
#apachecon on the Freenode IRC network.

Hope to see you in Austin!


AW: 64bit problem?

2015-02-27 Thread Dominik Psenner
Glad you were able to sort this out after all.

 

Cheers!

 

Von: thiemo.kell...@bfs.admin.ch [mailto:thiemo.kell...@bfs.admin.ch] 
Gesendet: Freitag, 27. Februar 2015 15:06
An: log4net-user@logging.apache.org
Betreff: AW: 64bit problem?

 

YAH!

 

Thanks to all so kind to nudge me to the right solution. It was a security
issue after all NOT a architecture problem. I tried to load the dll on the
network by [void][Reflection.Assembly]::LoadFile($log4netDllPathString) .  I
did not try to re-configure PowerShell execution by global config file. But
I did change the load call to [void][Reflection.Assembly]::
UnsafeLoadFrom($log4netDllPathString)

 

Liebe Grüsse/Cordialement/Cordialità

 

Thiemo Kellner

 

--

Office fédéral de la statistique 
Espace de l'Europe 10 
2010 Neuchâtel / Suisse

IT-AB

Tel +41 32 71 36516

 

Von: thiemo.kell...@bfs.admin.ch mailto:thiemo.kell...@bfs.admin.ch
[mailto:thiemo.kell...@bfs.admin.ch] 
Gesendet: Freitag, 27. Februar 2015 14:45
An: log4net-user@logging.apache.org mailto:log4net-user@logging.apache.org

Betreff: AW: 64bit problem?

 

Thanks for the hint. I also found this configuration at
http://stackoverflow.com/questions/19957161/add-type-load-assembly-from-netw
ork-unc-share-error-0x80131515

 

However, I would prefer not to change the PowerShell behavior in general.
I’d rather to tweak a runtime setup. I am still investigation on that. I
will let you know the outcome.

 

Liebe Grüsse/Cordialement/Cordialità

 

Thiemo Kellner

 

--

Office fédéral de la statistique 
Espace de l'Europe 10 
2010 Neuchâtel / Suisse

IT-AB

Tel +41 32 71 36516

 

Von: Anthony Francisco [mailto:a...@recombulator.net] 
Gesendet: Freitag, 27. Februar 2015 14:40
An: 'Log4NET User'
Betreff: RE: 64bit problem?

 

Older versions of .NET made it hard to load assemblies from the network.
It’s much easier with .NET 4 and up by using the loadFromRemoveSources
configuration element.

 

See https://msdn.microsoft.com/en-us/library/dd409252(v=vs.110).aspx

See also:
http://weblog.west-wind.com/posts/2011/Mar/22/Loading-Assemblies-off-Network
-Drives 

 

So what this means is that you’ll need to update your powershell
configuration file. It sounds like you might not have privileges to do that
considering that you don’t have privileges to put log4net and other
assemblies on the local machine.

 

-  Ants

 

From: Dominik Psenner [mailto:dpsen...@gmail.com] 
Sent: Friday, 27 February, 2015 03:48
To: 'Log4NET User'
Subject: AW: 64bit problem?

 

It might be a security issue then.

 

For instance, loading a dll from a network share is (from the operating
systems point of view) a dangerous operation. When I try to open a zip file
on my computer which is located on a NAS that “lives” outside of the network
domain windows requires me to confirm 3 times a error message dialog at me
stating “Windows cannot open the folder. The compressed zipped folder is
invalid.”, but then it opens up just fine.

 

Yes, windows is like that..

 

Von: thiemo.kell...@bfs.admin.ch mailto:thiemo.kell...@bfs.admin.ch
[mailto:thiemo.kell...@bfs.admin.ch] 
Gesendet: Freitag, 27. Februar 2015 08:42
An: log4net-user@logging.apache.org mailto:log4net-user@logging.apache.org

Betreff: AW: 64bit problem?

 

I am affraid, the dll file is there. Following code snipped should make sure
it is before trying to load the dll 

 

  if (-not (Test-Path -Path $log4netDllPathString)) {

assert-fatal(

  'I cannot find the logging library at ' +

  $log4netDllPathString + '')

exit 1

  }

#
[void][Reflection.Assembly]::LoadFile('I:\WA_ANALYSE\AAA_INFA_CORE\Libs\log4
net-1.2.13\bin\net\4.0\release\log4net.dll')

  [void][Reflection.Assembly]::LoadFile($log4netDllPathString)

 

and I actually can see the file with

 

C:\Users\s00489dir
I:\WA_ANALYSE\AAA_INFA_CORE\Libs\log4net-1.2.13\bin\net\4.0\release\log4net.
dll

Volume in drive I is WA-REF$

Volume Serial Number is 2702-33EF

 

Directory of
I:\WA_ANALYSE\AAA_INFA_CORE\Libs\log4net-1.2.13\bin\net\4.0\release

 

18.11.2013  04:51   301'056 log4net.dll

   1 File(s)301'056 bytes

   0 Dir(s)  137'992'851'456 bytes free

 

I cannot put the library elsewhere.

 

Maybe there is an issue because it is a network drive but I would not know
why it would work on my own laptop then.

Liebe Grüsse/Cordialement/Cordialità

 

Thiemo Kellner

 

--

Office fédéral de la statistique 
Espace de l'Europe 10 
2010 Neuchâtel / Suisse

IT-AB

Tel +41 32 71 36516

 

Von: Radovan Raszka [mailto:ras...@hasam.cz] 
Gesendet: Freitag, 27. Februar 2015 07:54
An: 'Log4NET User'
Betreff: RE: 64bit problem?

 

It looks like powershell can’t find where log4net.dll is located. As log4net
is platform neutral (compiled as any CPU), I don’t think 32 x 64 bit OS is
issue.

Where you have log4net.dll installed? Probably is good idea to put it into
GAC.

Or put it into folder

AW: 64bit problem?

2015-02-27 Thread Dominik Psenner
You could leverage this security vulnerabilities mayhem if you’d copy the
dll to a local temp folder, load it, execute it, unload it when all the work
is done and finally remove the temporary file.. :)

 

Von: thiemo.kell...@bfs.admin.ch [mailto:thiemo.kell...@bfs.admin.ch] 
Gesendet: Freitag, 27. Februar 2015 13:54
An: log4net-user@logging.apache.org
Betreff: AW: 64bit problem?

 

It seem so confusing to me. If there was a security problem loading the
modules, I would suspect that my modules where not listed as available with

 

PS I:\wa_analyse\SIS_METASTAT\Files get-module -listavailable

 

 

Directory: C:\Windows\system32\WindowsPowerShell\v1.0\Modules

 

 

ModuleType NameExportedCommands

-- 

Manifest   ActiveDirectory {Get-ADRootDSE,
New-ADObject,...

Manifest   ADRMS   {Update-ADRMS,
Uninstall-ADRM...

Manifest   AppLocker   {Set-AppLockerPolicy,
Get-App...

Manifest   BestPractices   {Get-BpaModel,
Invoke-BpaMode...

Manifest   BitsTransfer{Add-BitsFile,
Remove-BitsTra...

Manifest   CimCmdlets  {Get-CimAssociatedInstance,
G...

Manifest   GroupPolicy {Backup-GPO, Copy-GPO,
Get-GP...

Script ISE {New-IseSnippet,
Import-IseSn...

Manifest   Microsoft.PowerShell.Diagnostics{Get-WinEvent, Get-Counter,
I...

Manifest   Microsoft.PowerShell.Host   {Start-Transcript,
Stop-Trans...

Manifest   Microsoft.PowerShell.Management {Add-Content, Clear-Content,
...

Manifest   Microsoft.PowerShell.Security   {Get-Acl, Set-Acl,
Get-PfxCer...

Manifest   Microsoft.PowerShell.Utility{Format-List, Format-Custom,
...

Manifest   Microsoft.WSMan.Management  {Disable-WSManCredSSP,
Enable...

Script PSDiagnostics   {Disable-PSTrace,
Disable-PSW...

Binary PSScheduledJob  {New-JobTrigger,
Add-JobTrigg...

Manifest   PSWorkflow
{New-PSWorkflowExecutionOptio...

Manifest   PSWorkflowUtility   Invoke-AsWorkflow

Manifest   ServerManager   {Get-WindowsFeature,
Add-Wind...

Manifest   TroubleshootingPack {Get-TroubleshootingPack,
Inv...

 

 

Directory: C:\Program Files\Microsoft Monitoring Agent\Agent\PowerShell

 

 

ModuleType NameExportedCommands

-- 

Binary Microsoft.MonitoringAgent.PowerS...
{Checkpoint-WebApplicationMon...

 

 

Directory: I:\WA_ANALYSE\AAA_INFA_CORE\Libs

 

 

ModuleType NameExportedCommands

-- 

Script BFS.Powershell.Logging  {assert-debug, assert-error,
...

Script BFS.Powershell.PowerCenter  {approve-pocallworkflows,
app...

Script BFS.Powershell.Utility  {get-basename, get-dirname,
g...

 

The availability on the workstation looks the same…

 

Ok, I found a book that states that binary modules, i.e. dll, usually cannot
be loaded from network drives for security reasons. But now if it *usually*
is not allowed how can I get the exception? I can see that the modules can
get loaded because they are not binary. It is, however, not investigated if
the happen to load binary modules themselves dynamically.

 

Liebe Grüsse/Cordialement/Cordialità

 

Thiemo Kellner

 

--

Office fédéral de la statistique 
Espace de l'Europe 10 
2010 Neuchâtel / Suisse

IT-AB

Tel +41 32 71 36516

 

Von: Dominik Psenner [mailto:dpsen...@gmail.com] 
Gesendet: Freitag, 27. Februar 2015 09:48
An: 'Log4NET User'
Betreff: AW: 64bit problem?

 

It might be a security issue then.

 

For instance, loading a dll from a network share is (from the operating
systems point of view) a dangerous operation. When I try to open a zip file
on my computer which is located on a NAS that “lives” outside of the network
domain windows requires me to confirm 3 times a error message dialog at me
stating “Windows cannot open the folder. The compressed zipped folder is
invalid.”, but then it opens up just fine.

 

Yes, windows is like that..

 

Von: thiemo.kell...@bfs.admin.ch mailto:thiemo.kell...@bfs.admin.ch
[mailto:thiemo.kell...@bfs.admin.ch] 
Gesendet: Freitag, 27. Februar 2015 08:42
An: log4net-user@logging.apache.org mailto:log4net-user@logging.apache.org

Betreff: AW: 64bit problem?

 

I am affraid, the dll file is there. Following code snipped should make sure
it is before trying to load the dll 

 

  if (-not (Test-Path -Path $log4netDllPathString)) {

assert-fatal(

  'I cannot find the logging library at ' +

  $log4netDllPathString + '')

exit 1

  }

#
[void][Reflection.Assembly

AW: 64bit problem?

2015-02-27 Thread Dominik Psenner
Let us know if that resolved your issue. It might be a handy reference to
future readers.

 

Von: thiemo.kell...@bfs.admin.ch [mailto:thiemo.kell...@bfs.admin.ch] 
Gesendet: Freitag, 27. Februar 2015 14:15
An: log4net-user@logging.apache.org
Betreff: AW: 64bit problem?

 

I could indeed… urgs.

 

Liebe Grüsse/Cordialement/Cordialità

 

Thiemo Kellner

 

--

Office fédéral de la statistique 
Espace de l'Europe 10 
2010 Neuchâtel / Suisse

IT-AB

Tel +41 32 71 36516

 

Von: Dominik Psenner [mailto:dpsen...@gmail.com] 
Gesendet: Freitag, 27. Februar 2015 14:13
An: 'Log4NET User'
Betreff: AW: 64bit problem?

 

You could leverage this security vulnerabilities mayhem if you’d copy the
dll to a local temp folder, load it, execute it, unload it when all the work
is done and finally remove the temporary file.. :)

 

Von: thiemo.kell...@bfs.admin.ch mailto:thiemo.kell...@bfs.admin.ch
[mailto:thiemo.kell...@bfs.admin.ch] 
Gesendet: Freitag, 27. Februar 2015 13:54
An: log4net-user@logging.apache.org mailto:log4net-user@logging.apache.org

Betreff: AW: 64bit problem?

 

It seem so confusing to me. If there was a security problem loading the
modules, I would suspect that my modules where not listed as available with

 

PS I:\wa_analyse\SIS_METASTAT\Files get-module -listavailable

 

 

Directory: C:\Windows\system32\WindowsPowerShell\v1.0\Modules

 

 

ModuleType NameExportedCommands

-- 

Manifest   ActiveDirectory {Get-ADRootDSE,
New-ADObject,...

Manifest   ADRMS   {Update-ADRMS,
Uninstall-ADRM...

Manifest   AppLocker   {Set-AppLockerPolicy,
Get-App...

Manifest   BestPractices   {Get-BpaModel,
Invoke-BpaMode...

Manifest   BitsTransfer{Add-BitsFile,
Remove-BitsTra...

Manifest   CimCmdlets  {Get-CimAssociatedInstance,
G...

Manifest   GroupPolicy {Backup-GPO, Copy-GPO,
Get-GP...

Script ISE {New-IseSnippet,
Import-IseSn...

Manifest   Microsoft.PowerShell.Diagnostics{Get-WinEvent, Get-Counter,
I...

Manifest   Microsoft.PowerShell.Host   {Start-Transcript,
Stop-Trans...

Manifest   Microsoft.PowerShell.Management {Add-Content, Clear-Content,
...

Manifest   Microsoft.PowerShell.Security   {Get-Acl, Set-Acl,
Get-PfxCer...

Manifest   Microsoft.PowerShell.Utility{Format-List, Format-Custom,
...

Manifest   Microsoft.WSMan.Management  {Disable-WSManCredSSP,
Enable...

Script PSDiagnostics   {Disable-PSTrace,
Disable-PSW...

Binary PSScheduledJob  {New-JobTrigger,
Add-JobTrigg...

Manifest   PSWorkflow
{New-PSWorkflowExecutionOptio...

Manifest   PSWorkflowUtility   Invoke-AsWorkflow

Manifest   ServerManager   {Get-WindowsFeature,
Add-Wind...

Manifest   TroubleshootingPack {Get-TroubleshootingPack,
Inv...

 

 

Directory: C:\Program Files\Microsoft Monitoring Agent\Agent\PowerShell

 

 

ModuleType NameExportedCommands

-- 

Binary Microsoft.MonitoringAgent.PowerS...
{Checkpoint-WebApplicationMon...

 

 

Directory: I:\WA_ANALYSE\AAA_INFA_CORE\Libs

 

 

ModuleType NameExportedCommands

-- 

Script BFS.Powershell.Logging  {assert-debug, assert-error,
...

Script BFS.Powershell.PowerCenter  {approve-pocallworkflows,
app...

Script BFS.Powershell.Utility  {get-basename, get-dirname,
g...

 

The availability on the workstation looks the same…

 

Ok, I found a book that states that binary modules, i.e. dll, usually cannot
be loaded from network drives for security reasons. But now if it *usually*
is not allowed how can I get the exception? I can see that the modules can
get loaded because they are not binary. It is, however, not investigated if
the happen to load binary modules themselves dynamically.

 

Liebe Grüsse/Cordialement/Cordialità

 

Thiemo Kellner

 

--

Office fédéral de la statistique 
Espace de l'Europe 10 
2010 Neuchâtel / Suisse

IT-AB

Tel +41 32 71 36516

 

Von: Dominik Psenner [mailto:dpsen...@gmail.com] 
Gesendet: Freitag, 27. Februar 2015 09:48
An: 'Log4NET User'
Betreff: AW: 64bit problem?

 

It might be a security issue then.

 

For instance, loading a dll from a network share is (from the operating
systems point of view) a dangerous operation. When I try to open a zip file
on my computer which is located on a NAS that “lives” outside of the network
domain windows requires me to confirm 3 times a error message dialog at me
stating “Windows cannot open the folder. The compressed zipped folder is
invalid

AW: 64bit problem?

2015-02-27 Thread Dominik Psenner
It might be a security issue then.

 

For instance, loading a dll from a network share is (from the operating
systems point of view) a dangerous operation. When I try to open a zip file
on my computer which is located on a NAS that “lives” outside of the network
domain windows requires me to confirm 3 times a error message dialog at me
stating “Windows cannot open the folder. The compressed zipped folder is
invalid.”, but then it opens up just fine.

 

Yes, windows is like that..

 

Von: thiemo.kell...@bfs.admin.ch [mailto:thiemo.kell...@bfs.admin.ch] 
Gesendet: Freitag, 27. Februar 2015 08:42
An: log4net-user@logging.apache.org
Betreff: AW: 64bit problem?

 

I am affraid, the dll file is there. Following code snipped should make sure
it is before trying to load the dll 

 

  if (-not (Test-Path -Path $log4netDllPathString)) {

assert-fatal(

  'I cannot find the logging library at ' +

  $log4netDllPathString + '')

exit 1

  }

#
[void][Reflection.Assembly]::LoadFile('I:\WA_ANALYSE\AAA_INFA_CORE\Libs\log4
net-1.2.13\bin\net\4.0\release\log4net.dll')

  [void][Reflection.Assembly]::LoadFile($log4netDllPathString)

 

and I actually can see the file with

 

C:\Users\s00489dir
I:\WA_ANALYSE\AAA_INFA_CORE\Libs\log4net-1.2.13\bin\net\4.0\release\log4net.
dll

Volume in drive I is WA-REF$

Volume Serial Number is 2702-33EF

 

Directory of
I:\WA_ANALYSE\AAA_INFA_CORE\Libs\log4net-1.2.13\bin\net\4.0\release

 

18.11.2013  04:51   301'056 log4net.dll

   1 File(s)301'056 bytes

   0 Dir(s)  137'992'851'456 bytes free

 

I cannot put the library elsewhere.

 

Maybe there is an issue because it is a network drive but I would not know
why it would work on my own laptop then.

Liebe Grüsse/Cordialement/Cordialità

 

Thiemo Kellner

 

--

Office fédéral de la statistique 
Espace de l'Europe 10 
2010 Neuchâtel / Suisse

IT-AB

Tel +41 32 71 36516

 

Von: Radovan Raszka [mailto:ras...@hasam.cz] 
Gesendet: Freitag, 27. Februar 2015 07:54
An: 'Log4NET User'
Betreff: RE: 64bit problem?

 

It looks like powershell can’t find where log4net.dll is located. As log4net
is platform neutral (compiled as any CPU), I don’t think 32 x 64 bit OS is
issue.

Where you have log4net.dll installed? Probably is good idea to put it into
GAC.

Or put it into folder where powershell is installed. Key is to find where
powershell tried to find log4net.dll – is it possible to discover this info?

Radovan

 

From: thiemo.kell...@bfs.admin.ch mailto:thiemo.kell...@bfs.admin.ch
[mailto:thiemo.kell...@bfs.admin.ch] 
Sent: Thursday, February 26, 2015 4:19 PM
To: log4net-user@logging.apache.org mailto:log4net-user@logging.apache.org

Subject: AW: 64bit problem?

 

Assuming that on either system the most resent framework gets loaded, on
both systems 4.0.30319 is used. However, on the server there are both
flavours, 32 and 64 bit. I do not know which one is loaded.

 

I forgot to mention that we use log4net 1.2.13, in case this makes a
difference. The powershell version on the server is 3, on the laptop it is
4.

 

Liebe Grüsse/Cordialement/Cordialità

 

Thiemo Kellner

 

--

Office fédéral de la statistique 
Espace de l'Europe 10 
2010 Neuchâtel / Suisse

IT-AB

Tel +41 32 71 36516

 

Von: Dominik Psenner [mailto:dpsen...@gmail.com] 
Gesendet: Donnerstag, 26. Februar 2015 15:40
An: 'Log4NET User'
Betreff: AW: 64bit problem?

 

To be honest, the error message is rather cryptic to me. What I know is that
log4net is not compiled against a specific architecture. If the targeted
.NET framework is installed it should work. Have you checked that?

 

Von:  mailto:thiemo.kell...@bfs.admin.ch thiemo.kell...@bfs.admin.ch [
mailto:thiemo.kell...@bfs.admin.ch mailto:thiemo.kell...@bfs.admin.ch] 
Gesendet: Donnerstag, 26. Februar 2015 13:48
An: log4net-user@logging.apache.org mailto:log4net-user@logging.apache.org

Betreff: AW: 64bit problem?

 

I found https://issues.apache.org/jira/browse/LOG4NET-138 . Maybe there is a
problem?

 

Liebe Grüsse/Cordialement/Cordialità

 

Thiemo Kellner

 

--

Office fédéral de la statistique 
Espace de l'Europe 10 
2010 Neuchâtel / Suisse

IT-AB

Tel +41 32 71 36516

 

Von: thiemo.kell...@bfs.admin.ch mailto:thiemo.kell...@bfs.admin.ch
[mailto:thiemo.kell...@bfs.admin.ch] 
Gesendet: Donnerstag, 26. Februar 2015 13:36
An: log4net-user@logging.apache.org mailto:log4net-user@logging.apache.org

Betreff: 64bit problem?

 

Hi all

 

I am at my wits’ end. We developped PowerShell script which uses log4net. I
can run the script successfully from a batch file on my laptop but on the
server I get

 

Attempting to perform the InitializeDefaultDrives operation on the
'FileSystem'

provider failed.

I:\WA_ANALYSE\AAA_INFA_CORE\Scripts\metadata_join_params-thiemo.ps1 :

Exception calling LoadFile with 1 argument(s): The parameter is

incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG

AW: AppenderSkeletion lock in DoAppend

2015-03-04 Thread Dominik Psenner
Hi,

 

from what I can recall it could happen that the formatted representation of a 
logging event gets mixed up with data from other events and thus the characters 
streamed to a sink become garbage (i.e. a file, console, ..) if this lock is 
removed.

 

Internally a lot of things are cached to improve performance and these caches 
actually require proper locking.

 

But my memory might be wrong, so feel free to remove the lock and let several 
threads log events to your appender to see if it can handle it properly. :)

 

Cheers

 

Von: Gert Kello [mailto:gert.ke...@gmail.com] 
Gesendet: Mittwoch, 04. März 2015 09:28
An: log4net-user@logging.apache.org
Betreff: AppenderSkeletion lock in DoAppend

 

Hi.

I'm trying to create a database appender which high throughput... I looked at 
code in AppenderSekeletion.DoAppend() method and saw following comment:

public void DoAppend(LoggingEvent loggingEvent)
{
  // This lock is absolutely critical for correct formatting
  // of the message in a multi-threaded environment.  Without
  // this, the message may be broken up into elements from
  // multiple thread contexts (like get the wrong thread ID).

  lock (this)
  {

I would like to remove this lock from my code but there's a couple of issues I 
do not understand:

1. As I do not know the internals of log4net well enough I do not understand 
why lock is important for message formatting? Is it because the Layout.Format 
is not supposed to be thread safe? Or is it because the same instance of 
m_renderWriter could be used by multiple threads (well, usage of m_renderWriter 
is protected by another lock, added later. But AFAIK the 
RenderLoggingEvent(LoggingEvent loggingEvent) is still not 100% thread safe)

2. The comment does not mention that lock is crucial for m_recursiveGuard to 
work correctly. That's my main complaint: I almost overlooked the issue of 
potentially skipped logging events.

3. What about implementations of IFilter.Decide? Are those (supposed to be) 
thread safe?

Gert



AW: AppenderSkeletion lock in DoAppend

2015-03-04 Thread Dominik Psenner
A log event might be badly programmed and recursive by definition. Think of two 
objects that try each to log while trying to format each other:

 

A {

DoWork() {

   Log(“A: {0}”, B)

}

}

B {

DoWork () {

   Log(“B: {0}”, A)

}

}

 

I might be wrong, but something like that does the recursive guard detect and 
resolve.

 

For the other question you’ll have to accept my apologies because I can’t 
answer the question „how to write code“. :)

 

Von: Gert Kello [mailto:gert.ke...@gmail.com] 
Gesendet: Mittwoch, 04. März 2015 15:16
An: Log4NET User
Betreff: Re: AppenderSkeletion lock in DoAppend

 

But what about this m_recursiveGuard? Is the recursion protection needed? 
Perhaps it is, if log saving code logs something by itself? (Like warning that 
database operation takes longer than expected)?

Well, as I plan to make the database saving asyn I need to tackle this problem 
anyway... I think I would like to log the performance problem. But not when the 
problem occurs during saving log about the same performance problem. Is there 
any guideline how to write such code? Something like using OnlyOnceErrorHandler 
or is there anything similar for warnings?

 

Gert

 

On 4 March 2015 at 15:38, Dominik Psenner dpsen...@gmail.com 
mailto:dpsen...@gmail.com  wrote:

Hi,

 

from what I can recall it could happen that the formatted representation of a 
logging event gets mixed up with data from other events and thus the characters 
streamed to a sink become garbage (i.e. a file, console, ..) if this lock is 
removed.

 

Internally a lot of things are cached to improve performance and these caches 
actually require proper locking.

 

But my memory might be wrong, so feel free to remove the lock and let several 
threads log events to your appender to see if it can handle it properly. :)

 

Cheers

 

Von: Gert Kello [mailto:gert.ke...@gmail.com mailto:gert.ke...@gmail.com ] 
Gesendet: Mittwoch, 04. März 2015 09:28
An: log4net-user@logging.apache.org mailto:log4net-user@logging.apache.org 
Betreff: AppenderSkeletion lock in DoAppend

 

Hi.

I'm trying to create a database appender which high throughput... I looked at 
code in AppenderSekeletion.DoAppend() method and saw following comment:

public void DoAppend(LoggingEvent loggingEvent)
{
  // This lock is absolutely critical for correct formatting
  // of the message in a multi-threaded environment.  Without
  // this, the message may be broken up into elements from
  // multiple thread contexts (like get the wrong thread ID).

  lock (this)
  {

I would like to remove this lock from my code but there's a couple of issues I 
do not understand:

1. As I do not know the internals of log4net well enough I do not understand 
why lock is important for message formatting? Is it because the Layout.Format 
is not supposed to be thread safe? Or is it because the same instance of 
m_renderWriter could be used by multiple threads (well, usage of m_renderWriter 
is protected by another lock, added later. But AFAIK the 
RenderLoggingEvent(LoggingEvent loggingEvent) is still not 100% thread safe)

2. The comment does not mention that lock is crucial for m_recursiveGuard to 
work correctly. That's my main complaint: I almost overlooked the issue of 
potentially skipped logging events.

3. What about implementations of IFilter.Decide? Are those (supposed to be) 
thread safe?

Gert

 



AW: Debug info file for log4net release

2015-03-05 Thread Dominik Psenner
I’m taking this to log4net-dev since this goes well beyond the usage of log4net.

 

The pdb’s are not included because they are not required in a production 
release and were never included in a release so far because most users do not 
need them at all but could get confused with these files.

 

If you need to debug log4net you should run it from source since the release is 
both downloadable as a source package and available in svn so that people can 
check out the source. Doing a checkout should be possible without the 
requirement of any credentials and does not pose a significant hurdle. Feel 
free to open an issue if you disagree and would like to have the pdb files in 
future releases.

 

Von: Gert Kello [mailto:gert.ke...@gmail.com] 
Gesendet: Donnerstag, 05. März 2015 13:01
An: Log4NET User
Betreff: Debug info file for log4net release

 

Hi.

Is it possible to download the log4net.pdb file for 
log4net-1.2.13-bin-newkey.zip? So that debugging log4net would be possible 
without making custom build.



Is there some reason why it is not included in zip? Would You consider adding 
it to coming releases?

Gert

 



AW: AppenderSkeletion lock in DoAppend

2015-03-05 Thread Dominik Psenner
Taking this to log4net dev since this goes well beyond the usage of log4net, 
too.

 

Logs are typically written by software that is programmed, aren’t they? Thus 
one could happen to recursively trying to log something in his source code 
without being aware of it. Maybe the example was not clear enough and I 
apologize for not being verbose enough.

 

I tried to say that a log event could try to get a formatted message of the 
event by doing an invoke of another method and that method could again try to 
format the log message by calling the other method. This then ends up in a 
cyclic/recursive invoke and I believe that the recursive check tries to tackle 
this issue so that the application does not crash by trying to log something 
that might be totally unimportant.

 

I’m not sure if I understand what you mean with not threadsafe. A method that 
is not threadsafe can only be not threadsafe if it modifies data that is out of 
scope. It’s up to you how you implement the interface, but it might well happen 
that data gets modified without you being aware of it. One good example is the 
GlobalContext, which can easily be used in a manner that is not threadsafe at 
all.

 

Cheers

 

Von: Gert Kello [mailto:gert.ke...@gmail.com] 
Gesendet: Donnerstag, 05. März 2015 12:09
An: Log4NET User
Betreff: Re: AppenderSkeletion lock in DoAppend

 

Sorry but I fail to understand this example... Log event programmed? I didn't 
know I can program it... (without changing log4net source).

So far I know/see two cases where recursive logging can happen:

1. Something called from Appender.Append calls anu ILog logging methods

2. According to comment in https://issues.apache.org/jira/browse/LOG4NET-288 
the bad configuration can also cause the recursion.

I assume that's all that can cause recursions... As I plan to save logs from 
another thread I have to pay special attention to item 1. as any logging from 
database save procedure would cause the same logging to be executed again 
(tested). Without recursion but still flooding log system with endless messages.

But what about IFilter.Decide? Should I assume it is not threadsafe?

 

Gert

 

 

On 4 March 2015 at 16:51, Dominik Psenner dpsen...@gmail.com 
mailto:dpsen...@gmail.com  wrote:

A log event might be badly programmed and recursive by definition. Think of two 
objects that try each to log while trying to format each other:

 

A {

DoWork() {

   Log(“A: {0}”, B)

}

}

B {

DoWork () {

   Log(“B: {0}”, A)

}

}

 

I might be wrong, but something like that does the recursive guard detect and 
resolve.

 

For the other question you’ll have to accept my apologies because I can’t 
answer the question „how to write code“. :)

 

Von: Gert Kello [mailto:gert.ke...@gmail.com mailto:gert.ke...@gmail.com ] 
Gesendet: Mittwoch, 04. März 2015 15:16
An: Log4NET User
Betreff: Re: AppenderSkeletion lock in DoAppend

 

But what about this m_recursiveGuard? Is the recursion protection needed? 
Perhaps it is, if log saving code logs something by itself? (Like warning that 
database operation takes longer than expected)?

Well, as I plan to make the database saving asyn I need to tackle this problem 
anyway... I think I would like to log the performance problem. But not when the 
problem occurs during saving log about the same performance problem. Is there 
any guideline how to write such code? Something like using OnlyOnceErrorHandler 
or is there anything similar for warnings?

 

Gert

 

On 4 March 2015 at 15:38, Dominik Psenner dpsen...@gmail.com 
mailto:dpsen...@gmail.com  wrote:

Hi,

 

from what I can recall it could happen that the formatted representation of a 
logging event gets mixed up with data from other events and thus the characters 
streamed to a sink become garbage (i.e. a file, console, ..) if this lock is 
removed.

 

Internally a lot of things are cached to improve performance and these caches 
actually require proper locking.

 

But my memory might be wrong, so feel free to remove the lock and let several 
threads log events to your appender to see if it can handle it properly. :)

 

Cheers

 

Von: Gert Kello [mailto:gert.ke...@gmail.com mailto:gert.ke...@gmail.com ] 
Gesendet: Mittwoch, 04. März 2015 09:28
An: log4net-user@logging.apache.org mailto:log4net-user@logging.apache.org 
Betreff: AppenderSkeletion lock in DoAppend

 

Hi.

I'm trying to create a database appender which high throughput... I looked at 
code in AppenderSekeletion.DoAppend() method and saw following comment:

public void DoAppend(LoggingEvent loggingEvent)
{
  // This lock is absolutely critical for correct formatting
  // of the message in a multi-threaded environment.  Without
  // this, the message may be broken up into elements from
  // multiple thread contexts (like get the wrong thread ID).

  lock (this)
  {

I would like to remove this lock from my code but there's a couple of issues I 
do not understand:

1. As I do not know

AW: 64bit problem?

2015-02-26 Thread Dominik Psenner
To be honest, the error message is rather cryptic to me. What I know is that
log4net is not compiled against a specific architecture. If the targeted
.NET framework is installed it should work. Have you checked that?

 

Von: thiemo.kell...@bfs.admin.ch [mailto:thiemo.kell...@bfs.admin.ch] 
Gesendet: Donnerstag, 26. Februar 2015 13:48
An: log4net-user@logging.apache.org
Betreff: AW: 64bit problem?

 

I found https://issues.apache.org/jira/browse/LOG4NET-138 . Maybe there is a
problem?

 

Liebe Grüsse/Cordialement/Cordialità

 

Thiemo Kellner

 

--

Office fédéral de la statistique 
Espace de l'Europe 10 
2010 Neuchâtel / Suisse

IT-AB

Tel +41 32 71 36516

 

Von: thiemo.kell...@bfs.admin.ch mailto:thiemo.kell...@bfs.admin.ch
[mailto:thiemo.kell...@bfs.admin.ch] 
Gesendet: Donnerstag, 26. Februar 2015 13:36
An: log4net-user@logging.apache.org mailto:log4net-user@logging.apache.org

Betreff: 64bit problem?

 

Hi all

 

I am at my wits’ end. We developped PowerShell script which uses log4net. I
can run the script successfully from a batch file on my laptop but on the
server I get

 

Attempting to perform the InitializeDefaultDrives operation on the
'FileSystem'

provider failed.

I:\WA_ANALYSE\AAA_INFA_CORE\Scripts\metadata_join_params-thiemo.ps1 :

Exception calling LoadFile with 1 argument(s): The parameter is

incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

At line:1 char:1

+ I:\WA_ANALYSE\AAA_INFA_CORE\Scripts\metadata_join_params-thiemo.ps1

-stat_activi ...

+

~

~~~

+ CategoryInfo  : NotSpecified: (:) [Write-Error],
WriteErrorExcep

   tion

+ FullyQualifiedErrorId :
Microsoft.PowerShell.Commands.WriteErrorExceptio

   n,metadata_join_params-thiemo.ps1

 

 

I found
http://stackoverflow.com/questions/10249406/powershell-v2-load-a-com-interop
-dll which points to a possible problem with mixing 32 dlls in 64 bit
PowerShell. As my laptop is 32 and the server 64 bit, I was wondering if
this might cause the problem. At least I could pin the line of code where
the exception gets thrown:
[void][Reflection.Assembly]::LoadFile($log4netDllPathString)

 

Has anyone an idea?

 

Liebe Grüsse/Cordialement/Cordialità

 

Thiemo Kellner

 

--

Office fédéral de la statistique 
Espace de l'Europe 10 
2010 Neuchâtel / Suisse

IT-AB

Tel +41 32 71 36516

 



Re: unintended usage of the same configuration file

2015-10-11 Thread Dominik Psenner
The concept behind how web applications work makes it hard to use file
appenders. A web application should not access a filesystem directly and
punching holes into permissions may not be advisable. If i had to work out
a web app i would log to the database that the web application will require
anyway.

jmtc
On 11 Oct 2015 4:26 a.m., "tasos"  wrote:

> Hello.
> I'm working on a .net application and i have used this guidance
> http://haacked.com/archive/2005/03/07/ConfiguringLog4NetForWebApplications.aspx/
> There is a project on which i have added in the assemblyinfo.cs
> [assembly: log4net.Config.XmlConfigurator(ConfigFile = "foo1.config",
> Watch = true)]
> and in another one(different assembly)
> [assembly: log4net.Config.XmlConfigurator(ConfigFile = "foo2.config",
> Watch = true)]
> My configurations are like this http://pastebin.com/UpSpwMHH
> except the different output filenames
> ( )
> The problem is that the assembly that uses foo1.config writes on the output
> file of the file that is configured in foo2.config.
> In each class i use log4net i declare as the guidance site(mentioned
> above) says:
>
> private static readonly ILog Log = 
> LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
>
> Thank you in advance for your help!
>
>
>


Re: Why is log4net not more similar to log4j(2)?

2015-10-07 Thread Dominik Psenner
I think Piers wanted to know what differences between log4j and log4net 
caused you to start this thread.


Cheers

On 2015-10-06 19:39, Nicholas Duane wrote:
I'm not aware of all the differences, though I am the one that started 
this thread.  From what I've been told, log4net was a port of log4j 
1.0.  I assume log4j 1.0 continued on and changed and log4net lagged 
behind.  log4j 2.0, I'm also told, is significantly different from 
log4j 1.0 and thus significantly different from log4net.


My suggestion was to "port" log4j 2.0 to .NET.  I have emphasized port 
so that what I'm suggesting wouldn't be confused with trying to make 
changes to the existing log4net to make it more similar to log4j2.  I 
see benefit in having one logging framework work on both the major 
platforms.


In my mind it would seem to make sense to have one logging 
architecture/design and have that ported to both java and .NET, as 
well as any other major languages/frameworks.


Thanks,
Nick


Date: Tue, 6 Oct 2015 21:52:25 +0800
Subject: Re: Why is log4net not more similar to log4j(2)?
From: piers.willi...@gmail.com
To: log4net-user@logging.apache.org

Could someone please explain to some of the lurkers on these lists 
(like myself) what the differences we are talking about actually are?


In the .net world the accusations against log4net have largely been 
around the length of time to support new framework features properly 
(clr 2 lightweight locking models, and now probably lamda logging 
statements and structured logging). Would be interested to see what 
would be *gained* in a v2 port effort.


On 17 Sep 2015 5:42 am, "Nicholas Duane" > wrote:


Sending to both the log4j and log4net mailing lists.

I'm curious why log4net is not more similar to log4j(2)?  Is it
because there is less development work being done on log4net and
log4j had significant changes in the 2.0 version?  Any chance
log4net might become more of a "port" of log4j(2) and thus be more
similar?

Thanks,
Nick





Re: unintended usage of the same configuration file

2015-10-13 Thread Dominik Psenner
That, and given that a web application usually requires a database 
connection anyway. This means that it is less hassle to set up, does not 
require yet another administration tool, can be accesses from remote, 
may work more easily when you have to migrate the application to another 
server, allows you to "cloudify" the web app more easily, .. All these 
things sum up to a clear decision, at least for me. But mileage may vary.


Best regards,
Dominik

On 2015-10-13 00:48, Piers Williams wrote:


Nicholas,

The AdoNetAppender is *already* a buffering appender, with a default 
batch size of (I think) 100 for performance reasons as you suggest 
(both for the sake of your app and the poor database server).


Buffering does mean however that if your app tanks you probably lose 
the log message that let you know why, hence again value of 
(synchronous) file logging.


On 12 Oct 2015 10:47 pm, "Nicholas Duane" <nic...@msn.com 
<mailto:nic...@msn.com>> wrote:


I would agree that file based logging it core.  I would probably
not want my web application logging to a database, for sure not
each log statement. If there was some buffering in between which
batched the logs and then sent every once in a while to the DB
that would seem better, to me at least.  If I needed the logs in a
database I would still probably write to a local file and then
figure a way to get the files to a central location where they
could be loaded into the database.

Thanks,
Nick

To: dpsen...@gmail.com <mailto:dpsen...@gmail.com>;
log4net-user@logging.apache.org
<mailto:log4net-user@logging.apache.org>
From: piers.willi...@gmail.com <mailto:piers.willi...@gmail.com>
Subject: RE: unintended usage of the same configuration file
Date: Sun, 11 Oct 2015 22:27:44 +0800

Dominic: I’m afraid I don’t agree with any of what you said. File
based logging is a critical part of any instrumentation strategy –
it’s way faster than logging to a (typically remote) database, and
gives you somewhere to log the errors when the database is down.
That’s assuming you have a database at all of course – not all web
applications even have one (though I’d concede that’s rare).

It’s true that web applications will typically have limited
/write/ access to local disks, and that’s entirely appropriate,
but they always have some write permissions /somewhere/ – even if
it’s only to Temp. Establishing a location with write permissions
for logs hardly entails ‘punching holes in permissions’.

Finally, as best I can tell, none of this is relevant to the OP’s
actual issue, which would be just the same whether he was logging
to file or to database, because it’s a /configuration /issue.


*From: *Dominik Psenner
*Sent: *Sunday, 11 October 2015 2:35 PM
*To: *Log4NET User
*Subject: *Re: unintended usage of the same configuration file

The concept behind how web applications work makes it hard to use
file appenders. A web application should not access a filesystem
directly and punching holes into permissions may not be advisable.
If i had to work out a web app i would log to the database that
the web application will require anyway.
jmtc

On 11 Oct 2015 4:26 a.m., "tasos" <tas...@gmail.com
<mailto:tas...@gmail.com>> wrote:

Hello.
I'm working on a .net application and i have used this
guidance

http://haacked.com/archive/2005/03/07/ConfiguringLog4NetForWebApplications.aspx/
There is a project on which i have added in the assemblyinfo.cs
[assembly: log4net.Config.XmlConfigurator(ConfigFile =
"foo1.config", Watch = true)]
and in another one(different assembly)
[assembly: log4net.Config.XmlConfigurator(ConfigFile =
"foo2.config", Watch = true)]
My configurations are like this http://pastebin.com/UpSpwMHH
except the different output filenames
( )
The problem is that the assembly that uses foo1.config writes
on the output
file of the file that is configured in foo2.config.
In each class i use log4net i declare as the guidance
site(mentioned above) says:

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

||

|Thank you in advance for your help!|





Re: unintended usage of the same configuration file

2015-10-13 Thread Dominik Psenner

Unsubscription requires you to send a message to this address:

log4net-user-unsubscr...@logging.apache.org

from the email address that you have used to subscribe to this list.

On 2015-10-13 05:44, Yaron Berlinsky wrote:
I am trying to get off this distribution list, but unabe  to do so 
when following the unsubscribe procedure.


Can anyone help?


Sent from Samsung Mobile


 Original message 
From: Piers Williams
Date:13/10/2015 01:48 (GMT+02:00)
To: Log4NET User
Subject: RE: unintended usage of the same configuration file

Nicholas,

The AdoNetAppender is *already* a buffering appender, with a default 
batch size of (I think) 100 for performance reasons as you suggest 
(both for the sake of your app and the poor database server).


Buffering does mean however that if your app tanks you probably lose 
the log message that let you know why, hence again value of 
(synchronous) file logging.


On 12 Oct 2015 10:47 pm, "Nicholas Duane" <nic...@msn.com 
<mailto:nic...@msn.com>> wrote:


I would agree that file based logging it core.  I would probably
not want my web application logging to a database, for sure not
each log statement. If there was some buffering in between which
batched the logs and then sent every once in a while to the DB
that would seem better, to me at least.  If I needed the logs in a
database I would still probably write to a local file and then
figure a way to get the files to a central location where they
could be loaded into the database.

Thanks,
Nick

To: dpsen...@gmail.com <mailto:dpsen...@gmail.com>;
log4net-user@logging.apache.org
<mailto:log4net-user@logging.apache.org>
From: piers.willi...@gmail.com <mailto:piers.willi...@gmail.com>
Subject: RE: unintended usage of the same configuration file
Date: Sun, 11 Oct 2015 22:27:44 +0800

Dominic: I’m afraid I don’t agree with any of what you said. File
based logging is a critical part of any instrumentation strategy –
it’s way faster than logging to a (typically remote) database, and
gives you somewhere to log the errors when the database is down.
That’s assuming you have a database at all of course – not all web
applications even have one (though I’d concede that’s rare).

It’s true that web applications will typically have limited
/write/ access to local disks, and that’s entirely appropriate,
but they always have some write permissions /somewhere/ – even if
it’s only to Temp. Establishing a location with write permissions
for logs hardly entails ‘punching holes in permissions’.

Finally, as best I can tell, none of this is relevant to the OP’s
actual issue, which would be just the same whether he was logging
to file or to database, because it’s a /configuration /issue.


*From: *Dominik Psenner
*Sent: *Sunday, 11 October 2015 2:35 PM
*To: *Log4NET User
*Subject: *Re: unintended usage of the same configuration file

The concept behind how web applications work makes it hard to use
file appenders. A web application should not access a filesystem
directly and punching holes into permissions may not be advisable.
If i had to work out a web app i would log to the database that
the web application will require anyway.
jmtc

On 11 Oct 2015 4:26 a.m., "tasos" <tas...@gmail.com
<mailto:tas...@gmail.com>> wrote:

Hello.
I'm working on a .net application and i have used this
guidance

http://haacked.com/archive/2005/03/07/ConfiguringLog4NetForWebApplications.aspx/

<http://cp.mcafee.com/d/1jWVIe4xAe6jqb333xEVKztwTsSztUQsLELLCzBASztUQsLELzAQjqdTzhO-y--qem3qdTzhO-CyqerLCOSNH3y7NfB2xkI2xqRo_OVImJmfYKr747Cr8KfZvASnD7bIZuVtdCUXC1PBQT7eEyemKCHtBcSyrjdTV555MQsLe8FTdTdw0OuXoHW7bVIr4V6vNeZTYKPBNS2loeO8JNB0y5qAm0pYNuIg5Yw8bb7OJIVlxjwu7UrfGho1FtKDNbN-rso5T4NOpsJIqMUxYjVgElb72RGN_BMkvkyhB0zSHroD_00jqb9EVvpdwIqid43s9gDY4fgd43td8-q8aKCy2pfPh1jlvd45GMtAhrzIVlwq87p7-rvhdMODvjxM->
There is a project on which i have added in the assemblyinfo.cs
[assembly: log4net.Config.XmlConfigurator(ConfigFile =
"foo1.config", Watch = true)]
and in another one(different assembly)
[assembly: log4net.Config.XmlConfigurator(ConfigFile =
"foo2.config", Watch = true)]
My configurations are like this http://pastebin.com/UpSpwMHH

<http://cp.mcafee.com/d/FZsS81MQ76Qm6673hPt6X1KVJ6XNEVvhvvd7b9J6XNEVvhv79ECQrL6zBZ5ZYQsI6QrL6zBZd4QsTvdBJzm74fyva52Fo52RGN_BPoJqIvVsSe8fcShsvW_9ILeenpWZOWrdNTc3DbFKeth4sJtdmXapJcSCrLOaabxEVushjKrKr01HrivA9gVv0CIcb61IbxsSvkyM3iXtfynzYSUMbK9zAOVroRxN3UDOxgGme5Hlz_bwE-F4za17JmSNf-00CQmjhO-Or1oQAq86UixfU8uwq86WqhYQgltd44OvCy2CG-q8blwX8yT7pOH0QgeOfYS-yrWUUiQIbr>
except the different outp

Re: Why is log4net not more similar to log4j(2)?

2015-09-18 Thread Dominik Psenner
ing.apache.org; log4net-user@logging.apache.org
> > Subject: Re: Why is log4net not more similar to log4j(2)?
> > Date: Fri, 18 Sep 2015 09:25:00 +0200
> >
> > On 2015-09-17, Gary Gregory wrote:
> >
> > > "Patches welcome" is my motto :-)
> >
> > > Gary
> >
> > > On Wed, Sep 16, 2015 at 2:42 PM, Nicholas Duane <nic...@msn.com>
> wrote:
> >
> > >> Sending to both the log4j and log4net mailing lists.
> >
> > >> I'm curious why log4net is not more similar to log4j(2)? Is it because
> > >> there is less development work being done on log4net and log4j had
> > >> significant changes in the 2.0 version?
> >
> > > I think I read somewhere that log4net was a port of log4j 1.
> >
> > This is certainly part of the reason. log4net was started as a port of
> > 1.x a long time ago. The developers (long before I joined) added some
> > deviations that look closer to what log4j 2 is doing (XML
> > configuration).
> >
> > Incidently Dominik started a discussion about log4net 2.0 on the dev
> > list[1] and some people expressed interest. Any hand that can offer
> > some help is more than welcome, so please come over and join.
> >
> > [1] thread starting with
> http://mail-archives.apache.org/mod_mbox/logging-log4net-dev/201508.mbox/%3C03be01d0da4f%24a85aaa10%24f90ffe30%24%40apache.org%3E
> <http://mail-archives.apache.org/mod_mbox/logging-log4net-dev/201508.mbox/%3c03be01d0da4f$a85aaa10$f90ffe30$%40apache.org%3e>
> >
> > Stefan
> >
> > -
> > To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> > For additional commands, e-mail: log4j-user-h...@logging.apache.org
> >
>
>


-- 
Dominik Psenner


RE: Why is log4net not more similar to log4j(2)?

2015-09-18 Thread Dominik Psenner
Given that both c# and java are very similar in both syntax and interpreter
that runs the bytecode, users of log4j can expect a very steep learning
curve when starting with log4net. Despite that log4net is based on log4j
and thus may lack some things found in log4j2. These missing things and the
support for ancient versions of the .net framework caused my desire to
start off log4net2.

So, yes, log4net2 should be based on log4j2 and reuse all the knowledge
that has been generated within log4j2. It would be stupid to do otherwise.

All this can be achieved only with a rewrite. Im no fan of code generators,
therefore, translating java to c# will be no option to me. In the end we
would probably have to invest more time in analyzing and bugfixing
generated code.

The downside of a rewrite is that it is a lot of work and thus it takes
time. I can invest about an hour a week. Currently this hour goes into
responding questions on both user and dev mailingist. To make this real a
lot of helping hands will be required. Volunteers are welcome!

Cheers
On 18 Sep 2015 4:32 pm, "Nicholas Duane"  wrote:

> I looked over the thread you included below.  I can't tell from that
> whether the suggestion was to port log4j2.  Not sure if the comment about
> starting log4net 2.0 "from scratch" is an indication of having it be a port
> of log4j2.
>
> In my mind the biggest benefit would be to have the same
> architecture/feature set running on both linux and windows.  Of course it
> would also be great if the releases were synchronized.  I know a big gripe
> of log4net is that it's not getting rev'd.
>
> I would be interested in helping if the goal is to bring log4net in sync
> with log4j2.  And by this I guess I mean port as that would seem the
> easiest and safest path to the goal.
>
> I haven't worked on any open source project in the past.  I'm curious, how
> does this work?  Who's coordinating and making the decisions?
>
> Thanks,
> Nick
>
> > From: bode...@apache.org
> > To: log4j-u...@logging.apache.org; log4net-user@logging.apache.org
> > Subject: Re: Why is log4net not more similar to log4j(2)?
> > Date: Fri, 18 Sep 2015 09:25:00 +0200
> >
> > On 2015-09-17, Gary Gregory wrote:
> >
> > > "Patches welcome" is my motto :-)
> >
> > > Gary
> >
> > > On Wed, Sep 16, 2015 at 2:42 PM, Nicholas Duane 
> wrote:
> >
> > >> Sending to both the log4j and log4net mailing lists.
> >
> > >> I'm curious why log4net is not more similar to log4j(2)? Is it because
> > >> there is less development work being done on log4net and log4j had
> > >> significant changes in the 2.0 version?
> >
> > > I think I read somewhere that log4net was a port of log4j 1.
> >
> > This is certainly part of the reason. log4net was started as a port of
> > 1.x a long time ago. The developers (long before I joined) added some
> > deviations that look closer to what log4j 2 is doing (XML
> > configuration).
> >
> > Incidently Dominik started a discussion about log4net 2.0 on the dev
> > list[1] and some people expressed interest. Any hand that can offer
> > some help is more than welcome, so please come over and join.
> >
> > [1] thread starting with
> http://mail-archives.apache.org/mod_mbox/logging-log4net-dev/201508.mbox/%3C03be01d0da4f%24a85aaa10%24f90ffe30%24%40apache.org%3E
> >
> > Stefan
> >
> > -
> > To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> > For additional commands, e-mail: log4j-user-h...@logging.apache.org
> >
>


Re: Rolling File Operation : Failing with Source does not exist

2016-03-14 Thread Dominik Psenner

Hi,

which exact log4net version did cause this issue? log4net older than 
"last 3 years or so" leaves huge room for guessing. :-)


Cheers

On 2016-03-14 13:01, Kinnar wrote:

Hi All,

We are using log4net in our multi threaded windows service since last 3
years or so.  We have recently encountered that our device became
unresponsive/went into hanging state couple of time. While analyzing crash
dump of the service of that time, we have encountered that one of our thread
has failed during rolling file operation. The stack trace of failed thread
as follows :
   log4net.Util.LogLog.EmitErrorLine(System.String)
   log4net.Util.LogLog.Warn(System.Type, System.String)
   log4net.Appender.RollingFileAppender.RollFile(System.String,
System.String)
   log4net.Appender.RollingFileAppender.RollOverTime(Boolean)
   log4net.Appender.RollingFileAppender.AdjustFileBeforeAppend()
   log4net.Appender.RollingFileAppender.Append(log4net.Core.LoggingEvent)
   log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)
   
   

While going through error thrown by above stack trace, we have encountered
following error message :
   log4net:WARN Cannot RollFile [] -> []. Source does not exist

All other threads are waiting at following log4net method :
   log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)
  
log4net.Util.AppenderAttachedImpl.AppendLoopOnAppenders(log4net.Core.LoggingEvent)

   
   

Rolling File Pattern is as following :
 

We are not able to understand what is exactly wrong over here which causes
service to become unresponsive. Does rolling file operation cause the
thread, which is using it, to go into unresponsive state if some error
occurs ? We have gone through other posts which are telling to use different
datepattern but changing datepattern is not solving problem for everybody.
We would like to know what is the full proof way to solve this issue.

Thanks.



--
View this message in context: 
http://apache-logging.6191.n7.nabble.com/Rolling-File-Operation-Failing-with-Source-does-not-exist-tp62802.html
Sent from the Log4net - Users mailing list archive at Nabble.com.




Re: Rolling File Operation : Failing with Source does not exist

2016-03-18 Thread Dominik Psenner

You're welcome!

Happy hacking,
Cheers

On 2016-03-18 09:14, Kinnar wrote:

Hi Dominik,

Thanks for your updates. We will try out and let you know. Thanks for your
directions.

Regards,
Kinnar




--
View this message in context: 
http://apache-logging.6191.n7.nabble.com/Rolling-File-Operation-Failing-with-Source-does-not-exist-tp62802p62906.html
Sent from the Log4net - Users mailing list archive at Nabble.com.




Re: Rolling File Operation : Failing with Source does not exist

2016-03-19 Thread Dominik Psenner
Hi Kinnar,

The logging framework should never stop the show and such reports are
treated as serious bugs. Would you please share more information about your
log4net configuration?

Cheers

2016-03-15 14:39 GMT+01:00 Kinnar <kinnar.s...@navmanwireless.com>:

> Hi Dominik,
>
> Thanks for your feedback.
>
> We are using 1.2.13.0 version of log4net.
>
> We just like to have your view on whether the problem which we are facing
> can get the service into unresponsive state ? If yes, then changing date
> pattern won't help as it is still not solving problem as per other posts in
> same forum.
>
>
>
>
>
> --
> View this message in context:
> http://apache-logging.6191.n7.nabble.com/Rolling-File-Operation-Failing-with-Source-does-not-exist-tp62802p62843.html
> Sent from the Log4net - Users mailing list archive at Nabble.com.
>



-- 
Dominik Psenner


Re: Rolling File Operation : Failing with Source does not exist

2016-03-19 Thread Dominik Psenner
Hi again,

based on the information that you have multiple processes running, I think
that two processes decided to roll files at the same time. This probably
has caused a race condition and that again caused the show to stop.

The good news is that this scenario has been adressed in the latest log4net
release (1.2.15) and for you this means that you could try to update
log4net and see if the issue does no longer occur. Let us know what you try
and what the outcome was.

Cheers,
Dominik

2016-03-17 6:12 GMT+01:00 Kinnar <kinnar.s...@navmanwireless.com>:

> Hi Dominik,
>
> Please find appender configuration for which we are facing the problem as
> below :
>
>   type="log4net.Appender.RollingFileAppender">
>   
>   
>   
>   
>   
>   
>   
>   
>   
>   
>
>   
>type="log4net.Appender.RollingFileAppender+UniversalDateTime" />
> 
>
> Thanks in advance.
>
> Kinnar
>
>
>
> --
> View this message in context:
> http://apache-logging.6191.n7.nabble.com/Rolling-File-Operation-Failing-with-Source-does-not-exist-tp62802p62877.html
> Sent from the Log4net - Users mailing list archive at Nabble.com.
>



-- 
Dominik Psenner


Re: Performance of PatternLayout

2017-02-07 Thread Dominik Psenner
I dont have the issue number at hand, but this story sounds familiar and
there should be one filed on jira. If you have valuable information to add,
(ideally a patch) please use the search function to find the issue.

On 7 Feb 2017 9:02 a.m., "Martin Kozubek"  wrote:

> Hello,
>
> I have noticed performance hit after adding a custom property and using a
> PatternConverter to render it. It's the same for any context
> property(global,thread,event).  If there is a %property{smthing} in
> PatternConverter's string, the logging process results into call of
> Principal.WindowsIdentity.GetCurrent().Name.
>
> The code containing this call is in the LoggingEvent class. It is getter
> of property UserName. Since log4net v 1.2.12 the
> LoggingEvent.CreateCompositeProperties() is getting this property.  The
> problem is that this method is called once for logging event whenever there
> is some %property{} to be rendered.
>
> This results in that even if I don't use the username, but I add and use
> some custom property in the event, the logging process is ~10 times slower.
>
> I can solve it by programming my own layout instead of PatternLayout, but
> I am wondering if is it an expected behavior. Should that be reported to
> developers?
>
> MK
>
>
>


Re: Apache log4net Needs Help

2016-09-08 Thread Dominik Psenner



On 2016-09-08 06:05, Stefan Bodewig wrote:

Hi Justin

On 2016-09-08, Justin Taylor wrote:


I pulled down the source.  It builds fine but the unit tests fail
(log4net.vs2012.sln).  Is there some setup/prerequisites I've
overlooked?

Currently the official build system is the Nant build. I personally
don't use VS so am perfectly able to break the solution without noticin
it - but I think Dominik uses this solution file. In general the
solutions are supposed to work, though.


I usually do not build mono stuff with msbuild (i.e. visual studio 
projects) because I do not even have projects that run on mono. Thus the 
workflow for me is to hack on visual studio and as a last step I fire up 
nant to build and run the tests. Therefore it can be that the project 
does not build with visual studio.


That process is a little bit clumsy and therefore we should all agree on 
one build solution. From what I know about, msbuild can be customized to 
do about anything we want from it and as such it can also build mono 
assemblies. But we may as well drop the visual studio solutions and make 
nant/monodevelop our favorite hacking environment. We just have to find 
an agreement.




It looks as if you were using xbuild on Mono, this is something I have
considered myself before (as NAnt doesn't support recent versions of
Mono anymore). In this case the solution doesn't hold the mono specific
defines MONO,MONO_2_0,MONO_4_0 - I'm not sure how to solve that in an
environment specific way.


It's showing:
Passed 121  Failed 4Errors 31



Running 
log4net.vs2012.log4net.Tests.vs2012.log4net.Tests.Appender.AdoNetAppenderTest.BufferingWebsiteExample
 ...
log4net:ERROR XmlHierarchyConfigurator: Failed to construct object of type 
[log4net.Layout.PatternLayout] Exception: 
System.Reflection.TargetInvocationException: Exception has been thrown by the 
target of an invocation. ---> System.NullReferenceException: Object reference 
not set to an instance of an object
   at log4net.Util.PatternStringConverters.NewLinePatternConverter.ActivateOptions () 
<0x41403630 + 0x00014> in :0

This should have been fixed by svn revision 1759541 - which is

https://github.com/apache/log4net/commit/32b7a3ebc4c1123ea3bf55bb257b81e5d71ad130

Cheers

 Stefan




Re: Apache log4net Needs Help

2016-09-20 Thread Dominik Psenner
That's an interesting point. Would you mind to share your thoughts and 
reasons why you picked log4net over other logging frameworks beyond 
being a log4j port?



On 2016-09-20 01:30, Nicholas Duane wrote:


I can understand the breaking changes thing, but my impression is that 
straying from the log4j design is a bad idea.  What I think would be 
ideal is an apache logging architecture/design and then ports to java, 
log4j, and .NET, log4net.  One of the big benefits I see is having 
"relatively" the same logging framework run on both major platforms.



The one reason we picked log4net is because we chose lo4j2 on java.  
And having similar design was a benefit.  If we evaluated log4net on 
its own I'm not sure we would have picked it.



Thanks,

Nick


*From:* Walden H. Leverich <wald...@techsoftinc.com>
*Sent:* Monday, September 19, 2016 3:49 PM
*To:* Log4NET User
*Subject:* RE: Apache log4net Needs Help

>Any chance that we'll get a log4net version which is a "port" of the 
latest log4j2?


Maybe this is a discussion for the dev list, and granted I haven’t 
looked at what the changes are in log4j2, but my gut reaction is that 
a new port might be a bad idea. Yes, log4net started as a port of 
log4j (or at least that’s my understanding) but it’s a mature logging 
framework in its own right today with a huge user base and numerous 
production deployments. A new “port” sounds to me like it’s synonymous 
with breaking changes and that’s a colossally bad idea.


Are there things we can learn from the latest log4j2? Of course there 
are. Maybe there should be a log4net2 project? I don’t know. But 
whatever the evolution is of log4net it needs to be something that 
isn’t so revolutionary as to cause me to reevaluate my logging 
infrastructure.


-Walden

--
Walden H Leverich III
(516) 627-3800 x3051
wald...@techsoftinc.com <mailto:wald...@techsoftinc.com>

*From:*Nicholas Duane [mailto:nic...@msn.com]
*Sent:* Wednesday, September 14, 2016 9:19 AM
*To:* Log4NET User <log4net-user@logging.apache.org>
*Subject:* Re: Apache log4net Needs Help

I had asked about this in the past and I figured I would ask again 
after seeing this mail. Any chance that we'll get a log4net version 
which is a "port" of the latest log4j2?


Thanks,

Nick



*From:*Stefan Bodewig <bode...@apache.org <mailto:bode...@apache.org>>
*Sent:* Wednesday, September 14, 2016 12:32 AM
*To:* Log4NET User
*Subject:* Re: Apache log4net Needs Help

Welcome!

even though the official build system currently is NAnt, development
with your setup is supposed to work (if it doesn't, it is a bug).

The first thing you should do is to join the log4net-dev mailing list.

I think we need help in virtually any area - fixing bug, discussing
changes, documentation, testing ... you name it.

In general you pick what you want to work on, nobody is going to assign
work to anybody else. We are all doing this in our spare time and it is
supposed to be fun :-)

You may want to take a look at the JIRA issues to see whether you find
anything you'd like to work on. You know better than anybody else where
you can use your talent best - and what would be interesting to you.

Cheers

Stefan

On 2016-09-13, Shivinder Singh wrote:

> Hello,
> I use log4net too, but in Windows/IIS/Visual Studio environment. If 
there is anything I can do let me know.


> Thanks,
> Shivinder Singh
>> 1-409-330-3608
> shivindersi...@hotmail.com <mailto:shivindersi...@hotmail.com>


>> From: bode...@apache.org <mailto:bode...@apache.org>
>> To: log4net-...@logging.apache.org 
<mailto:log4net-...@logging.apache.org>

>> Subject: Apache log4net Needs Help
>> CC: log4net-user@logging.apache.org 
<mailto:log4net-user@logging.apache.org>; gene...@logging.apache.org 
<mailto:gene...@logging.apache.org>; d...@lucenenet.apache.org 
<mailto:d...@lucenenet.apache.org>

>> Date: Tue, 6 Sep 2016 06:12:19 +0200

>> This is a general call-to-arms for everyone who uses log4net as their
>> logging solution. If log4net is the logging framework that you are
>> using and would like to keep using in the future it is time now to get
>> involved. The project needs a larger developing community to move on!
>> We really need more people who want to shape the future of log4net at
>> the Apache Software Foundation.

>> In all the time since log4net has been started by Nicko Cadell more
>> than ten years ago, there have never been more than two or three
>> people regularly contributing to it. As is normal in open source
>> projects people have come and gone when their interests or just the
>> amount of time they could invest have changed.

>&g

Re: Apache log4net Needs Help

2016-10-03 Thread Dominik Psenner
One thing to note is that the development of a stable logging framework 
is rather slow. I would not want the most stable (in regards of features 
and API) part of a software to need regular updates. This is one of the 
main reasons why we mainly focus on stability issues. The lack of 
manpower influences the development of new features. There are a few 
ideas/issues that we would like to address, but with the estimated 
efforts we are unable to complete these tasks in the near future.



Note, too, that nobody here is going to sell you log4net as the logging 
framework that works for you. It is (probably) your task to find a 
solution that works for you. That said, I usually implement a logging 
facade in every project unless the project is too small or short-lived. 
This allows us to decouple the application from third party dependencies 
and increases maintainability. Until now we never had to change the 
logging framework but nobody can predict the future and it is better to 
have yet another layer of abstraction than having to refactor thousands 
of logging statements anytime in the future.



Beside that, what kind of feedback do you expect? I will gladly answer 
your questions.



Best regards

Dominik


On 03/10/2016 04:21, Nicholas Duane wrote:


Just curious if anyone has any feedback?  One reason I ask is because 
I again just got an email from someone in my group and it's in 
reference to the COE (Center Of Excellence) team wanting to recommend 
nlog for the enterprise for logging on Windows/.NET.



Thanks,

Nick



*From:* Nicholas Duane <nic...@msn.com>
*Sent:* Tuesday, September 20, 2016 10:03 AM
*To:* log4net-user@logging.apache.org
*Subject:* Re: Apache log4net Needs Help

Maybe a bit of history would help.


We had written our own logging framework a while back, prior to the 
launch of .NET.  It was a Windows only framework which under the 
covers used ETW (Event Trace for Windows), a very high performance 
logging mechanism which is used by the Windows kernel and other 
Microsoft products, like SQL Server.  Shortly after .NET was launched 
we created a managed interface for that.  That was running fine for 
10+ years and is still running fine.



More recently we had the need to capture a specific type of event 
across many application in the enterprise.  While we could have 
attempted to use our existing logging framework we would have needed 
to extend it for a couple reasons:



1. It was a Windows only framework and we would need to support both 
Windows and Java, the majority of Java applications running on Linux.



2.  It currently exposed a fixed set of events that could be raised.  
This new event would have to be added to the fixed set or we would 
have had to open up the API and allow the consumer to specify their 
own schema.



3. It captured the events in a relational database.  We want to route 
this new event to an HDFS backend.



We decided to look at off the shelf logging frameworks instead of 
creating one of our own.  While there are several logging frameworks 
on the java side, log4j/log4j2 appeared to be the clear winner.  On 
the .NET side there was no "clear" winner.  We looked at 
System.Diagnostics (the logging/tracing classes provided by .NET), 
nlog, log4net and Enterprise Logging (the application block).  From 
that list only nlog and log4net were viable options.  One of the major 
issues people had with log4net was the fact that it appeared it had 
been abandoned, which I guess it was.  The 1.2.13 release had been out 
for more than 2 years I think.  In fact, our .NET Center of Excellence 
team was recommending nlog for .NET and I think one of the main 
reasons for that was the lack of development on log4net.



There were a few things I liked about log4net.


* The fact that it was a port of log4j I saw as a benefit.  If I'm 
looking for a logging framework for both .net and java and I can get 
the same framework that works on both that's ideal.  It means both 
would roughly have the same or similar API and features.  Ideally the 
configuration is the same or similar for both.



* I'm pretty sure I looked over the nlog api and didn't like it as 
much as the log4net api.



* I also liked, and thought was a key feature, the "logger" 
inheritance feature of both log4net and log4j(2).



Thanks,

Nick


------------
*From:* Dominik Psenner <dpsen...@gmail.com>
*Sent:* Tuesday, September 20, 2016 2:26 AM
*To:* log4net-user@logging.apache.org
*Subject:* Re: Apache log4net Needs Help

That's an interesting point. Would you mind to share your thoughts and 
reasons why you picked log4net over other logging frameworks beyond 
being a log4j port?



On 2016-09-20 01:30, Nicholas Duane wrote:


I can understand the breaking changes thing, but my impression is 
that straying from the log4j design is 

Re: Apache log4net Needs Help

2016-11-05 Thread Dominik Psenner
2016-11-05 19:38 GMT+01:00 Stefan Bodewig <bode...@apache.org>:

> On 2016-11-05, Joe wrote:
>
> >> If you are willing to help, please join log4net's dev mailing list and
> raise your hand. Look through log4net's issue tracker and pick things you'd
> like to work on. If you don't know where to start, please ask, Dominik and
> Stefan will be there to help.
>
> >> If there is anything holding you back from contributing, let's discuss
> it and get it out of the way.
>
> > Looking through the log4net issue tracker, I find it difficult to pick
> > out things to work on.
>
> > - There are an awful lot of open issues that have been open for a long
> > time and are unassigned
>
> I've gone through them a long time ago when it looked like we had a plan
> of moving forward - that's why you may find some issues assigned to
> versions like 3.5 or 4. Reality has rendered those versions moot.
>
> > - Some of the ones I've looked through seem like they could be closed
> > as Won't fix, Incomplete, Cannot Reproduce, Later or Not a Bug.  Doing
> > this might show that things are moving and be an incentive for people
> > to get involved.
>
> Fine with me. So far I haven't closed any enhancement requests as I
> thought somebody might pick it up. But at the same time I knew I
> wouldn't be working on it. I've tried to keep up with real bug reports
> and enhancement requests that came with a path - but likely failed to do
> so as well.
>
> > - It would help to have a roadmap for the next couple of releases.
> > For example, if we know that someone is working on a revamped
> > RollingFileAppender, all issues related to RollingFileAppender should
> > be assigned to them.
>
> The main reason we've lacked a roadmap so far is that we've been
> reacting to reported bugs. I'd be happy if we could change this. Short
> term I'd love to see us release 2.0.6 as a sign of life.
>

A long time ago I had started a reimplementation of the RollingFileAppender
because we've seen that we cannot fix it without breaking compatibility or
redefining its features. Most of the issues related to the
RollingFileAppender should be marked as related issues to the rewrite
issue. I dont have the issue id at hand, though. If you wanted to pick up
that initial work and continue it would be awesome! Most probably I am
going to jump in helping you because the RollingFileAppender is one of the
most used features and therefore one of the crucial points where
performance and sanity can make a difference of users moving away from
log4net or attracting more users.


>
> > - Perhaps some of them need to be reprioritized, so that it's easier
> > to focus on what is high priority and consistent with the roadmap.
>
> Current priorities are most likely the ones set by the reporters. Which
> usually means everybody considers their issues the most important ones.
>

I tend to prioritize recent reports because the reporters of those old
issues most likely have found a workaround or moved to another logging
framework. Those issues are most likely to be closed because they are not
reproducable.

-- 
Dominik Psenner


Re: Injecting properties into LoggingEvent

2016-10-22 Thread Dominik Psenner
What I am proposing here are a mere ideas that will need further
investigation. I have not tried any of these ideas. You will have to
prioritize these ideas based on your requirements.

A. Implement an extension class for the ILog interface
B. Implement a custom ILog interface implementation and a LoggerFactory.
C. Define custom loglevels
D. Use thread context properties altogether with custom format layouts
E. Log "complex" classes that hold your category information and find a way
to format them

There might be more things that you could do..

On 22 Oct 2016 5:31 p.m., "Nicholas Duane"  wrote:

> Is there a way for me to inject properties into a LoggingEvent?  I'm
> trying to accomplish this without the user (of log4net) doing anything
> special.  The only thing I could think of was wrapping loggers, and while
> I'm not against doing that it would have to be done via configuration as I
> don't want the user to have to do it programmatically.  Is there any way
> for me to inject a logger wrapper via configuration?
>
>
> The reason I'm looking to do this is that I would like to set a property
> on the LoggingEvent to use for filtering.  This property would be
> determined based on the level property.  I could simply use the level
> property for filtering, but I have other events which I generate which are
> all logged at the Emergency level but have a different value for this
> property so for them I'm using this property for filtering.  I don't have
> the same issue with these other events because they are logged via an
> extension method I provided on the ILog interface:
>
>
> public static class Logging
>
> {
>
> public static void LogEvent(this ILog logger, Category category,
> IEvent evnt)
>
> {
>
> if ((category != null) && (evnt != null))
>
> {
>
> evnt.SetCategory(category.Name);
>
> LoggingEvent le = new LoggingEvent(null,
> logger.Logger.Respository,
>
> logger.Logger.Name, Level.Emergency, evnt, null);
>
> le.Properties["category"] = category.Name;
>
> logger.Logger.Log(le);
>
> }
>
> }
>
> }
>
>
> So for instance when a user does the following:
>
>
> logger.Error("this is my error message");
>
> or
>
> logger.Warn("this is my warning message");
>
> or
>
> logger.Info("this is my info message");
>
>
> I would like to set the property "category" on the LoggingEvent to
> "criticalDiagnostic".  When they do:
>
>
> logger.Debug("this is my debug message");
>
> or
>
> logger.Trace("this is my trace message");
>
>
> I would like to set the property "category" on the LoggingEvent to
> "noncriticalDiagnostic".  Any way for me to do that automagically?
>
> I also posted this at:
>
>
> http://stackoverflow.com/questions/40187597/injecting-
> properties-into-log4nets-loggingevent
>
>
> Thanks,
>
> Nick
>


Re: Injecting properties into LoggingEvent

2016-10-23 Thread Dominik Psenner
Sorry, I cannot grasp your requirements. Please try to explain your usecase
better in a way that gives the document some kind of structure.

On 23 Oct 2016 12:02 a.m., "Nicholas Duane" <nic...@msn.com> wrote:

> Thank you for the suggestions.
>
>
> We are already logging complex objects in many cases.  We have the notion
> of a compliance event.  That's basically a map (IDictionary<string,
> object>).  We're now adding business events.  However, even with these
> "complex" events I don't want the map to contain the category, at least not
> at event creation time.  I see an event as just a collection of
> properties.  The act of logging it at a certain level or category is what
> assigns the severity or category.  For example:
>
>
> logger.Warn("this is my warning message");
>
>
> logger.Error("this is my error message");
>
>
> logger.Info("this is my info message");
>
>
> In each of those cases if we assume the event is the message itself, there
> is no criticality associated with that event.  It's the act of logging that
> defines the event's criticality.  I want the same to be true for the
> category.  I believe I have this working fine for our "complex" events
> which don't fit into the Level gradient.  I expose a LogEvent() method
> which logs at the Emergency level as I showed in the code I included in the
> previous thread.  However, we also need to capture diagnostic events, ones
> that are logged via the logging framework's methods:
>
>
> logger.Error(...);
>
> logger.Warn(...);
>
>
> What I am hoping to do is hook in some of my code and generate one of our
> complex events each time the logging framework logs an event and will map
> the level to one of our categories.  I can imagine that this might be
> possible if I somehow wrap a logger, but as I mentioned I don't want the
> user to have to call anything special at startup to hook up that wrapping.
> I was hoping there would be a way for me to hook myself in via
> configuration.  I'm ok with giving them a configuration file they need to
> use but I don't want them to have to change any existing code them may have.
>
>
> By the way, we did generate a custom log level for our compliance event.
> However I'm trying to move away from that as it was point out that our
> events don't fit well within the level gradient.  So the new code for
> logging a compliance event does not use that level.  Both the compliance
> and business event would be logged at the Emergency level.  I would use the
> category property to differentiate them.  Similar, I guess, to log4j2's
> Markers.
>
>
> Thanks,
>
> Nick
>
>
> --
> *From:* Dominik Psenner <dpsen...@gmail.com>
> *Sent:* Saturday, October 22, 2016 1:29 PM
> *To:* Log4NET User
> *Subject:* Re: Injecting properties into LoggingEvent
>
>
> What I am proposing here are a mere ideas that will need further
> investigation. I have not tried any of these ideas. You will have to
> prioritize these ideas based on your requirements.
>
> A. Implement an extension class for the ILog interface
> B. Implement a custom ILog interface implementation and a LoggerFactory.
> C. Define custom loglevels
> D. Use thread context properties altogether with custom format layouts
> E. Log "complex" classes that hold your category information and find a
> way to format them
>
> There might be more things that you could do..
>
> On 22 Oct 2016 5:31 p.m., "Nicholas Duane" <nic...@msn.com> wrote:
>
>> Is there a way for me to inject properties into a LoggingEvent?  I'm
>> trying to accomplish this without the user (of log4net) doing anything
>> special.  The only thing I could think of was wrapping loggers, and while
>> I'm not against doing that it would have to be done via configuration as I
>> don't want the user to have to do it programmatically.  Is there any way
>> for me to inject a logger wrapper via configuration?
>>
>>
>> The reason I'm looking to do this is that I would like to set a property
>> on the LoggingEvent to use for filtering.  This property would be
>> determined based on the level property.  I could simply use the level
>> property for filtering, but I have other events which I generate which are
>> all logged at the Emergency level but have a different value for this
>> property so for them I'm using this property for filtering.  I don't have
>> the same issue with these other events because they are logged via an
>> extension method I provided on the ILog interface:
>>
>>
>> public static class Loggin

Re: Injecting properties into LoggingEvent

2016-10-23 Thread Dominik Psenner
In that case you can pipe your log events through a custom appender that
you implement. That custom appender can implement your logic of events as
smart as you need it and then call inner appenders to process events. See
the bufferingappenderskeleton.

On 24 Oct 2016 12:52 a.m., "Nicholas Duane" <nic...@msn.com> wrote:

> Thanks.  I think I'm not quite explaining it well enough.  While I would
> like to set properties on the LoggingEvent class, it could not be
> accomplished similar to the way you suggest.  The reason is that the
> property I want to set, "category", would be based on the level the user is
> logging the event at and thus could not be done until the logging method
> was called.
>
>
> I don't think I'm asking the logging framework to do something way out of
> the ordinary.  All I'm trying to do is set a property based on the level,
> and I would like to do that without the user having to do anything, other
> than maybe including some config code which would allow me to inject my
> code into the equation.
>
>
> Thanks,
>
> Nick
>
> --
> *From:* Dominik Psenner <dpsen...@gmail.com>
> *Sent:* Sunday, October 23, 2016 3:13 PM
> *To:* Log4NET User
> *Subject:* Re: Injecting properties into LoggingEvent
>
>
> Responding inline..
>
> On 23 Oct 2016 4:04 p.m., "Nicholas Duane" <nic...@msn.com> wrote:
> >
> > Is there a way for me to add properties to a LoggingEvent without the
> user doing anything out of the ordinary.  Maybe it's even best to assume an
> existing application which is using log4net. I would like to take this
> existing log4net application and without them changing any code,
> configuration changes are ok, I would like to add properties to each
> LoggingEvent which is created from their log statements like:
> >
> >
> > logger.Error();
> >
> > logger.Info();
> >
> > logger.Debug();
> >
> > etc.
> >
> >
>
> That requirement sounds like you would like to:
>
> // thread properties... 
> log4net.LogicalThreadContext.Properties["CustomColumn"]
> = "Custom value"; log.Info("Message");
>
> // ...or global properties log4net.GlobalContext.Properties["CustomColumn"]
> = "Custom value";
>
> These automatically set these properties on the logging events and you can
> then filter those with a propertyfilter as you write here:
>
> > such that I could use the PropertyFilter filter to filter out events?  I
> want to set a property based on the level of the event.  I could of course
> use the LevelRangeFilter but in other cases I'm using the PropertyFilter
> and was figuring it might be nice to do it the same for all events.
> >
> >
> > This other case where I'm using the PropertyFilter is for new events
> we've introduced.  These are what we call "compliance" and "business"
> events.  We originally introduced a "compliance" event and at that time I
> introduced a custom level for that.  However, I'm trying to move away from
> defining custom levels and instead use a property on the event to
> distinguish its "category".  For these new events which don't fit nicely
> into the level gradient I've introduced a method for developers to use to
> log them called LogEvent().  They will pass in their logger, the category
> of the event, and the event.  In this scenario it's easy for me to set
> properties on the LoggingEvent.
>
> To me this sounds like you are trying to force the logging framework to do
> something different than the rest of the application logs do. If thats the
> case, then let me warn you that it might not be a good idea. Logs could be
> only a byproduct of the feature you would like to implement. If you are
> implementing application features through the logging framework, logging is
> too smart and does too much. Try to design your applocation so that it
> could do its job even if logging was not there.
>
> However it sounds like this works for you, therefore I do not try to work
> out anything.
>
> >  However, for what we call the diagnostic events, those that are logged
> using the methods exposed by log4net, we don't want them to have to do
> anything different than they were doing.  If they want to log an error they
> would still use:
> >
> >
> > logger.Error("this is my error");
> >
> >
> > or a warning:
> >
> >
> > logger.Warn("this is my warning");
> >
> >
> > etc.
> >
> >
> > Ideally I would like to set the "category" on those events also so that
> by the time they make

Re: Injecting properties into LoggingEvent

2016-10-24 Thread Dominik Psenner
Hm, we could provide a scripting language that allows you to customize
logging event properties but that scripting language wont ever suffice.

You are probably best off by implementing a facade that matches your needs
and hides the heavy lifting done the used logging framework.

On 24 Oct 2016 3:28 p.m., "Nicholas Duane" <nic...@msn.com> wrote:

> Thanks. We already have written a custom appender.  Ideally I want the
> category set by the time the event makes it to our appender.  As I
> mentioned, what I'm trying to do is the following:
>
>
> When someone logs an event I want to populate a property named "category"
> on the LoggingEvent which is based on the level of the event.
>
>
> level: FATAL - INFO -> set category to criticalDiagnostic
>
> level: DEBUG, TRACE -> set category to noncriticalDiagnostic
>
>
> I could imagine there could be many other reasons why someone might want
> to modify the LoggingEvent automatically without any user code to do so.
>
>
> As I mentioned, I don't want an application to make code changes to make
> this happen.  I'm looking for a config only solution for this.  You could
> imagine that the LogManager could expose a set of events and allow plugging
> in event sinks via configuration.  This would allow me to write an event
> sink and plug it into the system via the configuration.
>
>
> Thanks,
>
> Nick
>
> --
> *From:* Dominik Psenner <dpsen...@gmail.com>
> *Sent:* Monday, October 24, 2016 1:39 AM
> *To:* Log4NET User
> *Subject:* Re: Injecting properties into LoggingEvent
>
>
> Ps: this might also something that you should look at.
>
> http://stackoverflow.com/questions/17120943/how-add-custom-properties-in-
> appenderskeleton-log4net
>
> <http://stackoverflow.com/questions/17120943/how-add-custom-properties-in-appenderskeleton-log4net>
> How Add custom properties in ... - Stack Overflow
> <http://stackoverflow.com/questions/17120943/how-add-custom-properties-in-appenderskeleton-log4net>
> stackoverflow.com
> I Create Custom Appender(with AppenderSkeleton) that Connect to the Web
> Service... in this Appender i need to send some custom properties(like Url
> , Browser ,User ...
>
> And note too that the layoutpattern gets a applicationsetting pattern
> string to include application settings in the formatted logevent string.
> You can try that feature by building from source or by using the relerase
> candidate binaries.
>
> It is unclear where these "categories" come from if the developers do not
> maintain them. Therefore I am not able to understand your requirements.
>
> On 24 Oct 2016 7:21 a.m., "Dominik Psenner" <dpsen...@gmail.com> wrote:
>
>> In that case you can pipe your log events through a custom appender that
>> you implement. That custom appender can implement your logic of events as
>> smart as you need it and then call inner appenders to process events. See
>> the bufferingappenderskeleton.
>>
>> On 24 Oct 2016 12:52 a.m., "Nicholas Duane" <nic...@msn.com> wrote:
>>
>>> Thanks.  I think I'm not quite explaining it well enough.  While I would
>>> like to set properties on the LoggingEvent class, it could not be
>>> accomplished similar to the way you suggest.  The reason is that the
>>> property I want to set, "category", would be based on the level the user is
>>> logging the event at and thus could not be done until the logging method
>>> was called.
>>>
>>>
>>> I don't think I'm asking the logging framework to do something way out
>>> of the ordinary.  All I'm trying to do is set a property based on the
>>> level, and I would like to do that without the user having to do anything,
>>> other than maybe including some config code which would allow me to inject
>>> my code into the equation.
>>>
>>>
>>> Thanks,
>>>
>>> Nick
>>>
>>> --
>>> *From:* Dominik Psenner <dpsen...@gmail.com>
>>> *Sent:* Sunday, October 23, 2016 3:13 PM
>>> *To:* Log4NET User
>>> *Subject:* Re: Injecting properties into LoggingEvent
>>>
>>>
>>> Responding inline..
>>>
>>> On 23 Oct 2016 4:04 p.m., "Nicholas Duane" <nic...@msn.com> wrote:
>>> >
>>> > Is there a way for me to add properties to a LoggingEvent without the
>>> user doing anything out of the ordinary.  Maybe it's even best to assume an
>>> existing application which is using log4net. I would like to take this
>>&

Re: Injecting properties into LoggingEvent

2016-10-24 Thread Dominik Psenner

Yet another possible solution to your problem could be to do something like:

https://www.loggly.com/blog/why-json-is-the-best-application-log-format-and-how-to-switch/

On 2016-10-24 07:39, Dominik Psenner wrote:


Ps: this might also something that you should look at.

http://stackoverflow.com/questions/17120943/how-add-custom-properties-in-appenderskeleton-log4net

And note too that the layoutpattern gets a applicationsetting pattern 
string to include application settings in the formatted logevent 
string. You can try that feature by building from source or by using 
the relerase candidate binaries.


It is unclear where these "categories" come from if the developers do 
not maintain them. Therefore I am not able to understand your 
requirements.



On 24 Oct 2016 7:21 a.m., "Dominik Psenner" <dpsen...@gmail.com 
<mailto:dpsen...@gmail.com>> wrote:


In that case you can pipe your log events through a custom
appender that you implement. That custom appender can implement
your logic of events as smart as you need it and then call inner
appenders to process events. See the bufferingappenderskeleton.


On 24 Oct 2016 12:52 a.m., "Nicholas Duane" <nic...@msn.com
<mailto:nic...@msn.com>> wrote:

Thanks.  I think I'm not quite explaining it well enough. 
While I would like to set properties on the LoggingEvent

class, it could not be accomplished similar to the way you
suggest.  The reason is that the property I want to set,
"category", would be based on the level the user is logging
the event at and thus could not be done until the logging
method was called.


I don't think I'm asking the logging framework to do something
way out of the ordinary.  All I'm trying to do is set a
property based on the level, and I would like to do that
without the user having to do anything, other than maybe
including some config code which would allow me to inject my
code into the equation.


Thanks,

Nick


--------
*From:* Dominik Psenner <dpsen...@gmail.com
<mailto:dpsen...@gmail.com>>
*Sent:* Sunday, October 23, 2016 3:13 PM
*To:* Log4NET User
*Subject:* Re: Injecting properties into LoggingEvent

Responding inline..

On 23 Oct 2016 4:04 p.m., "Nicholas Duane" <nic...@msn.com
<mailto:nic...@msn.com>> wrote:
>
> Is there a way for me to add properties to a LoggingEvent
without the user doing anything out of the ordinary.  Maybe
it's even best to assume an existing application which is
using log4net. I would like to take this existing log4net
application and without them changing any code, configuration
changes are ok, I would like to add properties to each
LoggingEvent which is created from their log statements like:
>
>
> logger.Error();
>
> logger.Info();
>
> logger.Debug();
>
> etc.
>
>

That requirement sounds like you would like to:

// thread properties...
log4net.LogicalThreadContext.Properties["CustomColumn"] =
"Custom value"; log.Info("Message");

// ...or global properties
log4net.GlobalContext.Properties["CustomColumn"] = "Custom value";

These automatically set these properties on the logging events
and you can then filter those with a propertyfilter as you
write here:

> such that I could use the PropertyFilter filter to filter
out events? I want to set a property based on the level of the
event.  I could of course use the LevelRangeFilter but in
other cases I'm using the PropertyFilter and was figuring it
might be nice to do it the same for all events.
>
>
> This other case where I'm using the PropertyFilter is for
new events we've introduced.  These are what we call
"compliance" and "business" events.  We originally introduced
a "compliance" event and at that time I introduced a custom
level for that.  However, I'm trying to move away from
defining custom levels and instead use a property on the event
to distinguish its "category".  For these new events which
don't fit nicely into the level gradient I've introduced a
method for developers to use to log them called LogEvent(). 
They will pass in their logger, the category of the event, and

the event.  In this scenario it's easy for me to set
properties on the LoggingEvent.

  

Re: Level.All

2016-11-25 Thread Dominik Psenner

Level.Off = int.MaxValueLevel.Off + 1


On 2016-11-25 00:12, Piers Williams wrote:


All is not something you would log at, it's something to use as a 
threshold for a logger that should log everything. Because it's lower 
than all your message logging levels, they all get logged.



On 21 Oct 2016 11:25 am, "Nicholas Duane" > wrote:


Is Level.All correct?  I looked at it in reflector and it appears
to be Level.Off + 1, but since it's a signed int that turns it
into a large negative number.  This seems to be causing me some
problems. I'm trying to implement something like log4j's
EventLogger which I think logs events at level All such that as
long as logging is not turned off the events will make it into the
logging system.  However, when I log an event at Level.All in
log4net it's not getting logged and my guess is because Level.All
is negative and thus less than all of the predefined levels.  And
since my level threshold is set at INFO my events are getting
thrown out.


Is this by design or a bug?


Thanks,

Nick





Re: Level.All

2016-11-25 Thread Dominik Psenner

Ops, that earlier mail went out too early. Sorry for the noise. ;-)

Level.Off = int.MaxValue
Level.All = Level.Off + 1

This implies that:
Level.All = int.MinValue

which is correct. You should not log events with Level.All or Level.Off. 
There are so many numbers in between int.MinValue and int.MaxValue that 
there's lot of room to invent custom levels.


On 2016-11-25 00:12, Piers Williams wrote:


All is not something you would log at, it's something to use as a 
threshold for a logger that should log everything. Because it's lower 
than all your message logging levels, they all get logged.



On 21 Oct 2016 11:25 am, "Nicholas Duane" > wrote:


Is Level.All correct?  I looked at it in reflector and it appears
to be Level.Off + 1, but since it's a signed int that turns it
into a large negative number.  This seems to be causing me some
problems. I'm trying to implement something like log4j's
EventLogger which I think logs events at level All such that as
long as logging is not turned off the events will make it into the
logging system.  However, when I log an event at Level.All in
log4net it's not getting logged and my guess is because Level.All
is negative and thus less than all of the predefined levels.  And
since my level threshold is set at INFO my events are getting
thrown out.


Is this by design or a bug?


Thanks,

Nick





Re: Issue with Custom Appender

2016-11-04 Thread Dominik Psenner

Hi Dave,

would you please send us a the complete log4net internal logs including 
debug logs?


Anyway it smells like an issue with incompatible binaries. You could 
check if both the log4net assembly that your custom appender was linked 
against and the log4net assembly that your application was linked 
against are the same. There is a log4net assembly with strong name out 
there and one that has no strong name. Or you may have even linked your 
appender against a log4net assembly that you have built from source?


Cheers

On 2016-11-04 09:15, DaveS wrote:

I have created a custom appender to work alongside two other appenders. The
problem I have having is that the custom appender isn't receiving any logs.

My custom appender simply inherits from AppenderSkeleton. However, I have
also tried creating my own appender that implements IAppender.


My application is a Windows Form application, written in C# using VS2015. I
am targetting .Net 4.5.2. "Any CPU"

I am using Log4Net version v2.0.5 from NuGet (version 1.2.15.0)

Within the application config I have

  
   
   
   
   
 

 
 


My custom appender is being found as the program stops at a break point in
the constructor. However, the overridden Append() is never called.

The OUTPUT window contains the following details:
Exception thrown: 'System.InvalidCastException' in log4net.dll
log4net:ERROR XmlHierarchyConfigurator: Could not create Appender
[MemoryAppender] of type [.CustomAppender,].
Reported error follows.
System.InvalidCastException: Unable to cast object of type
'.CustomAppender' to type 'log4net.Appender.IAppender'.
at
log4net.Repository.Hierarchy.XmlHierarchyConfigurator.ParseAppender(XmlElement
appenderElement)
log4net:ERROR XmlHierarchyConfigurator: Appender named [MemoryAppender] not
found.



Any suggestions to fix this issue would be gratefully received.




--
View this message in context: 
http://apache-logging.6191.n7.nabble.com/Issue-with-Custom-Appender-tp70625.html
Sent from the Log4net - Users mailing list archive at Nabble.com.




Re: Issue with Custom Appender

2016-11-04 Thread Dominik Psenner

Glad you were able to sort this out!

Cheers

On 2016-11-04 14:32, DaveS wrote:

Solved.

I had a reference to version 1.2.10 which was causing this version to be
loaded from the GAC.







--
View this message in context: 
http://apache-logging.6191.n7.nabble.com/Issue-with-Custom-Appender-tp70625p70639.html
Sent from the Log4net - Users mailing list archive at Nabble.com.




Re: IIS Deadlocks happening all the sudden after years of running with no issues

2017-05-22 Thread Dominik Psenner
2017-05-22 18:38 GMT+02:00 Jim Scott <jsc...@infoconex.com>:
>
> >> Did any modifications happen lately that you are aware of?
>
> The only thing I can see is that the box has been getting regular windows
> updates which of course includes .NET and OS updates. Could it be that
> something in the framework has changed behavior of something that is now
> creating this issue?
>

Not that I am aware of, but that means nothing.


>  >> Please note that it is known that an application can also cause
> log4net to deadlock [3].
> >> [3] https://issues.apache.org/jira/browse/LOG4NET-298
>
> This particular application is not using any async/task code so not sure
> if other scenarios apply?
>

That's not true. All it needs is two threads and the well known dead lock
candidates (waits, locks, ..). Does your web application pass objects on to
the logging framework or are all arguments converted to immutable types
(string, int, bool, ..)? If the logging framework calls ToString() of an
object, beware!


> >> Further there is also this issue [4].
> >> [4] https://issues.apache.org/jira/browse/LOG4NET-178
>
> We are not seeing an issue with logging stopping and we also changed our
> app pool recycle to a specific time rather than the default of 1720
> minutes. When we have had our deadlock issue it has not been during an app
> pool recycle (unless IIS was trying to kick the process for other reasons,
> although nothing in event viewer indicating something was trying to
> recycle). Anything in this particular bug that you think I might want to
> look at that still might be related even though the symptom is not the same?
>

No idea but at the same time this is not the first thing I would spend time
on.


>
>
> We have also installed Debug Diagnostics on the machine to take memory
> dumps and analyze the results and this made it really easy to determine the
> deadlock issue and provide the traces previously. If you have any
> suggestions for further diagnosing it would be appreciated. Was thinking
> that maybe I would have enabled log4net debugging?
>

That's a great starting point. Maybe something fishy jumps out that makes
it easier. You could further investigate the behavior of your web
application when the dead lock happened.

Please note also that 1.2.11 is from 2011 and rather old. Can you give a
newer log4net version a shot?

Cheers
-- 
Dominik Psenner


Re: IIS Deadlocks happening all the sudden after years of running with no issues

2017-05-22 Thread Dominik Psenner
2017-05-22 23:54 GMT+02:00 Jim Scott <jsc...@infoconex.com>:

>
>
> *From:* Dominik Psenner
> *Sent:* Monday, May 22, 2017 1:27 PM
>
>
>
>>  >> Please note that it is known that an application can also cause
>> log4net to deadlock [3].
>> >> [3] https://issues.apache.org/jira/browse/LOG4NET-298
>>
>> This particular application is not using any async/task code so not sure
>> if other scenarios apply?
>>
>
> >> That's not true. All it needs is two threads and the well known dead
> lock candidates (waits, locks, ..). Does your web application pass objects
> on to the logging framework or are all >> arguments converted to immutable
> types (string, int, bool, ..)? If the logging framework calls ToString() of
> an object, beware!
>
> I will have to do some investigating to see. However I know we log
> exceptions using log.Error(“Exception details”, ex) and it seems that every
> time this issue occurs it is happening while attempt to write an exception
> to the exception.log we have configured. Note that according to the stack
> trace it appears that the exceptions log is attempting to be rolled when
> the issue happens. I can also see now that our exceptions log is
> intermittently getting rolled whereas the other logs seem to be rolling as
> expected. One thing different about this logging configuration for
> exceptions is that we are using MinimalLock so that the file can be cleared.
>

Put this on the list of possible causes. I would rather always go with
FileAppender.ExclusiveLock
<http://logging.apache.org/log4net/log4net-1.2.12/release/sdk/log4net.Appender.FileAppender.ExclusiveLock.html>,
also from a performance point of view. I observed a speedup factor that is
often beyond 20.


>
>
>>
>>
>> We have also installed Debug Diagnostics on the machine to take memory
>> dumps and analyze the results and this made it really easy to determine the
>> deadlock issue and provide the traces previously. If you have any
>> suggestions for further diagnosing it would be appreciated. Was thinking
>> that maybe I would have enabled log4net debugging?
>>
>
> >> That's a great starting point. Maybe something fishy jumps out that
> makes it easier. You could further investigate the behavior of your web
> application when the dead lock happened.
>
> What suggestions might you have with regards to investigating the behavior
> of the web application when the deadlock happened?
>

Looks like you already figured out something I was referring to. Often it
is enough to know what the users did to track down what an application
should do (and possibly should but does not). After all it boils down to a
few scenarios and that helps a lot, just like you pointed out the
MinimalLock for exceptions.


>
> >> Please note also that 1.2.11 is from 2011 and rather old. Can you give
> a newer log4net version a shot?
>
> That was my next move actually. We use 1.2.13.0 on a few other projects
> and since we have been using reliably in those applications was going to
> see if moving to it made any difference. This project has a number of
> dependencies that are all compiled again 1.2.11.0 so was going to use the
> following approach.
>
> Update to 1.2.13.0
> Add this to web.config to redirect to 1.2.13.0
> 
> 
>   
> 
>  newVersion="1.2.13.0"/>
>   
> 
> 
>
>
I did not know this was even possible. :-) The api should still be the
same, so there should be no obstacles unless one dependency uses the strong
name assembly. Then it should (to my knowledge) accept only the one it was
linked against.

-- 
Dominik Psenner


Re: IIS Deadlocks happening all the sudden after years of running with no issues

2017-05-22 Thread Dominik Psenner

Hi Jim,

please don't expect a sensible response within hours, especially with 
such a complex problem. :-) At first sight, if it did run for over two 
years and suddenly keeps crashing on a daily basis it is very unlikely 
that something that was not modified is the actual culprit. Did any 
modifications happen lately that you are aware of?


Please note that IIS has some interesting default behavior, it would for 
instance start a new instance of a site before the old site is 
destroyed. This means that multiple instances of the same site use the 
same configuration and are therefore going to log and roll into the same 
files. This is well known [1] [2] and has been raised as an issue 
several times on this list. The symptoms you see sound very much like 
that, but note that this is just a guess. Please note that it is known 
that an application can also cause log4net to deadlock [3]. Further 
there is also this issue [4].


I hope this gives you enough information to dig deeper. Let us know what 
the actual root cause was and how you solved it. We may be able to 
condense documentation that helps future readers.


Cheers,
Dominik

[1] 
https://www.google.it/search?q=log4net+iis+deadlock=log4net+iis+deadlock

[2] http://hectorcorrea.com/blog/log4net-thread-safe-but-not-process-safe/17
[3] https://issues.apache.org/jira/browse/LOG4NET-298
[4] https://issues.apache.org/jira/browse/LOG4NET-178

On 2017-05-20 21:26, Jim Scott wrote:

Is this list still active? Would this be better to post to the dev list?

On May 19, 2017, at 3:45 PM, Jim Scott > wrote:


We have a webservice that has been running on Windows 2008R2 since 
Nov 2015 and has not had any issues until just a week or so ago. The 
webservice becomes unresponsive and after installing some debug tools 
I can see that we have a deadlock issue.
Here is some details of the last dump. Note we are running the 
project under .NET 4 and have .NET 2 dependencies in the project that 
depend on the .NET 2 1.2.11.0 version of log4net. I can see also on 
the stack trace that we had a few exceptions happen and I assume the 
blocking thread was attempting to roll our Exceptions.log file 
because the create time on the file was from yesterday. At the bottom 
of the email is a copy of our logging configuration which we wire up 
during Application_Start.
We thought it might have originally been related to permissions as 
someone had deleted the exception.log and recreated it and it was 
owned by them but we fixed that last night and we had another crash 
this morning. I am stumped since no code has changed on this box and 
nothing unusual about the type of activity. Maybe something in a .NET 
patch changed behavior?

Any assistance would be appreciated.
Thanks
Jim
Thread that appears to be blocking everything
Entry point *clr!Thread::intermediateThreadProc*
Create time *5/19/2017 1:05:32 PM*
Time spent in user mode *0 Days 00:10:06.359*
Time spent in kernel mode   *0 Days 00:02:51.203*



This thread is trying to acquire a System.Threading.ReaderWriterLock 
for *reading*


*The thread has evidence of _.net exceptions_ on the stack. Check the 
Previous .NET Exceptions Report (Exceptions in all .NET Thread 
Stacks) to view more details of the associated exception *


*.NET Call Stack*


[[HelperMethodFrame_1OBJ] (System.Array.Copy)] 
System.Array.Copy(System.Array, Int32, System.Array, Int32, Int32, 
Boolean)

mscorlib_ni!System.Array.Copy(System.Array, System.Array, Int32)+3e
mscorlib_ni!System.Security.Permissions.FileIOPermission.AddPathList(System.Security.Permissions.FileIOPermissionAccess, 
System.Security.AccessControl.AccessControlActions, System.String[], 
Boolean, Boolean, Boolean)+5a
mscorlib_ni!System.Security.Permissions.FileIOPermission..ctor(System.Security.Permissions.FileIOPermissionAccess, 
System.String[], Boolean, Boolean)+2a

mscorlib_ni!System.IO.Path.GetFullPath(System.String)+5c
mscorlib_ni!System.IO.Path.GetDirectoryName(System.String)+a2
log4net.Appender.RollingFileAppender.CombinePath(System.String, 
System.String)+38

log4net.Appender.RollingFileAppender.RollOverTime(Boolean)+16c
log4net.Appender.RollingFileAppender.AdjustFileBeforeAppend()+d3
log4net.Appender.RollingFileAppender.Append(log4net.Core.LoggingEvent)+13 


log4net.Appender.AppenderSkeleton.DoAppend(log4net.Core.LoggingEvent)+f0
log4net.Util.AppenderAttachedImpl.AppendLoopOnAppenders(log4net.Core.LoggingEvent)+a0 

log4net.Repository.Hierarchy.Logger.CallAppenders(log4net.Core.LoggingEvent)+82 

log4net.Repository.Hierarchy.Logger.ForcedLog(System.Type, 
log4net.Core.Level, System.Object, System.Exception)+4a
log4net.Repository.Hierarchy.Logger.Log(System.Type, 
log4net.Core.Level, System.Object, System.Exception)+64

log4net.Core.LogImpl.ErrorFormat(System.String, System.Object[])+6a


Example thread blocked


  Thread 36 - System ID 7332

Entry point *clr!Thread::intermediateThreadProc*
Create 

Fwd: Moving log4net-logviewer to apache

2017-09-09 Thread Dominik Psenner
Hi fellows!

This is a call for opinions.

What does the community think should happen? Are there people out there who
use log4net-logviewer or any of its binaries?

Cheers,
Dominik


On 6 Sep 2017 3:08 p.m., "Oskar Gewalli" <gewa...@gmail.com> wrote:


> On 6 Sep 2017, at 15:03, Dominik Psenner <dpsen...@gmail.com> wrote:
>
>
> On 2017-09-06 14:17, Oskar Gewalli wrote:
>> Hi,
>>
>> Perhaps it would be better to create a dedicated library to just the
log4net xml parsing? The GUI and CLI tools could then depend on that
package.
>>
>> Since the log parsing parts are much smaller and not very special.
>
> I don't have the insights to be able to comment on this. Would you please
explain the main difference between chainsaw, log2console and
log4net-logviewer?
>

The main benefit of using log4net-logviewer is to use the logparsing
abilities to be able to aggregate and do log statistics from the raw logs.

The GUI and CLI bits can potentially be removed, since there are already
chainsaw and log2console.

>>
>> Best regards from Oskar
>>
>>> On 6 Sep 2017, at 13:54, Dominik Psenner <dpsen...@gmail.com> wrote:
>>>
>>> Hi Oskar,
>>>
>>> log4net-logviewer is a tool that includes both a command line and a ui
frontend written in wpf/xaml that both can parse logfiles and provide users
a better view on log events. According to the readme this is a alternative
to log2console and chainsaw. I don't like it to have multiple tools that do
the same thing. Would you please explain the main differences between the
projects?
>>>
>>> I further noticed that there are at least a few legal issues like
unclear licensing that would definitely prevent the adoption of the
project. Further I see no personal interest to take over the maintenance of
more projects as that would definitely exceed the spare time I have
available. Therefore it would be great if we could merge the communities to
gain a larger community to maintain all of these projects.
>>>
>>> Best regards,
>>> Dominik
>>>
>>>
>>> On 2017-09-06 12:49, Oskar Gewalli wrote:
>>>> We currently have a project on github that might be better if it's
under the stewardship of apache (since apache owns log4net)
>>>>
>>>> https://github.com/wallymathieu/log4net-logviewer/issues/7#i
ssuecomment-327421829 <https://github.com/wallymathi
eu/log4net-logviewer/issues/7#issuecomment-327421829>
>>>>
>>>> What do you think?
>>>>
>>>> Best regards from Oskar Gewalli
>





-- 
Dominik Psenner


Re: Log4Net v2.0.8 - SMTP appender not relaying emails on Windows Server 2003

2017-11-14 Thread Dominik Psenner
log4net should not even compile if it referenced classes that do not exist
in a targetted framework. Note that this might be related to
https://issues.apache.org/jira/browse/LOG4NET-548 too. This could be a
symptom of the fact that net 4.5 is a in place replacement of net 4.0. You
should be able to confirm this if you tried to compile log4net on a machine
that has only net 4.0 installed. Unfortunately i have no possibility to
evaluate this because I have no operating system to evaluate this on.

On 13 Nov 2017 5:58 p.m., "Mohkam Singh Sawhney" <singh...@yahoo.com> wrote:

Hi Dominik,

I reviewed the accepted answer on the link that you shared.

Our application is a console application that was compiled against .net
framework 4. We are using the framework 4.0 version of the log4net
dll.  Windows
server 2003 does not support .net framework 4.5.

ClaimsIdentity Class was introduced in framework 4.5. (
https://msdn.microsoft.com/en-us/library/system.security.
claims.claimsidentity.aspx). Why is the log4net dll referencing this class?

[image: Inline image]


Thanks and Regards

Mohkam Singh

------
*From:* Dominik Psenner <dpsen...@gmail.com>
*To:* Log4NET User <log4net-user@logging.apache.org>; Mohkam Singh Sawhney <
singh...@yahoo.com>
*Sent:* Monday, November 13, 2017 12:16 AM
*Subject:* Re: Log4Net v2.0.8 - SMTP appender not relaying emails on
Windows Server 2003

Googling yields this:

https://social.msdn.microsoft.com/Forums/en-US/378905e5-
297b-4235-a170-f519d77f02b9/iis7-web-app-error-could-not-load-type-
systemsecurityclaimsclaimsidentity-from-assembly?forum=csharpgeneral

On 12 Nov 2017 11:36 a.m., "Mohkam Singh Sawhney" <singh...@yahoo.com>
wrote:

We were using Log4Net v1.2.13.0 with an application that targets .net
framework 4 on windows server 2003, Below is the SmptAppender configuration
(hiding our production values with ). We were able to receive email on
'FATAL' log entry.


  
  
  
  
  
  
  

  

  


We recently updated our application to use Log4Net v2.0.8, with the same
configuration for SmptAppender . After this update, we stopped receiving
emails. On enabling the internal log4Net logging, the below error was
logged.

log4net: Created Appender [SmtpAppender]
log4net: Adding appender named [SmtpAppender] to logger [root].
log4net: Hierarchy Threshold []
log4net:ERROR [SmtpAppender] ErrorCode: GenericFailure. Failed in DoAppend
System.TypeLoadException: Could not load type 'System.Security.Claims.
ClaimsIdentity' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken= b77a5c561934e089'.
   at log4net.Core.LoggingEvent.get_ UserName()
   at log4net.Core.LoggingEvent. FixVolatileData(FixFlags flags) in
c:\log4net\tags\2.0.8RC1\src\ Core\LoggingEvent.cs:line 1341
   at log4net.Appender. BufferingAppenderSkeleton. Append(LoggingEvent
loggingEvent) in c:\log4net\tags\2.0.8RC1\src\ Appender\
BufferingAppenderSkeleton.cs: line 483
   at log4net.Appender. AppenderSkeleton.DoAppend( LoggingEvent
loggingEvent) in c:\log4net\tags\2.0.8RC1\src\
Appender\AppenderSkeleton.cs: line 317
log4net: Shutdown called on Hierarchy [log4net-default-repository]

If we revert back to Log4Net v1.2.13.0, we start receiving emails as
expected. Please advise how can we resolve the issue with version 2.0.8.


Thanks and Regards

Mohkam Singh


Re: Not included License.txt for log4net.dll

2017-11-18 Thread Dominik Psenner
https://logging.apache.org/log4net/download_log4net.cgi

2017-11-18 15:58 GMT+01:00 くろやなぎ ひろあき <kuroyan...@outlook.jp>:

>
>
> I am considering using 'yu-packprint-r', a Japanese C/S Application, but I
> can not check the License.txt
>
> even though I include log4net.dll.
>
> How can I explain to Japan Post as the distributor?
>
>
>
> I asked a question to Japan Post.
>
> | [Concerns]
>
> | Do you need to include "Apache License Version 2.0" in license notation?
>
> | --> It seems that log4net.dll and RestSharp.dll are Apache License
> Version 2.0 licenses.
>
> | [懸念事項]
>
> | ライセンス表記に「Apache License Version 2.0」を含める必要がありませんか。
>
> | ⇒ log4net.dll や RestSharp.dll は、Apache License Version 2.0ライセンス
>
> |かと思われます。
>
>
>
>
>
> Japan Post say(answer):
>
> | As concerns are not supported, we can not answer.
>
> | 懸念事項についてはサポート対象外のためお答えいたしかねます。
>
>
>
>
>
>
>
> Users page(In Japanese):
>
> https://www.post.japanpost.jp/yu-packprint-r/member/sql/index.html
>
>
>
> Installer(In Japanese):
>
> https://www.post.japanpost.jp/yu-packprint-r/member/download/sqlinstall/
> YprSQL20170908_dotnetfxDL.zip
>
>
>
> Home page(In English):
>
> https://www.post.japanpost.jp/index_en.html
>
>
>



-- 
Dominik Psenner


Re: Log4Net v2.0.8 - SMTP appender not relaying emails on Windows Server 2003

2017-11-12 Thread Dominik Psenner
Googling yields this:

https://social.msdn.microsoft.com/Forums/en-US/378905e5-297b-4235-a170-f519d77f02b9/iis7-web-app-error-could-not-load-type-systemsecurityclaimsclaimsidentity-from-assembly?forum=csharpgeneral

On 12 Nov 2017 11:36 a.m., "Mohkam Singh Sawhney" 
wrote:

> We were using Log4Net v1.2.13.0 with an application that targets .net
> framework 4 on windows server 2003, Below is the SmptAppender configuration
> (hiding our production values with ). We were able to receive email on
> 'FATAL' log entry.
>
> 
>   
>   
>   
>   
>   
>   
>value="true" />
> 
>   
> 
>   
> 
>
> We recently updated our application to use Log4Net v2.0.8, with the same
> configuration for SmptAppender . After this update, we stopped receiving
> emails. On enabling the internal log4Net logging, the below error was
> logged.
>
> log4net: Created Appender [SmtpAppender]
> log4net: Adding appender named [SmtpAppender] to logger [root].
> log4net: Hierarchy Threshold []
> log4net:ERROR [SmtpAppender] ErrorCode: GenericFailure. Failed in DoAppend
> System.TypeLoadException: Could not load type 
> 'System.Security.Claims.ClaimsIdentity'
> from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=
> b77a5c561934e089'.
>at log4net.Core.LoggingEvent.get_UserName()
>at log4net.Core.LoggingEvent.FixVolatileData(FixFlags flags) in
> c:\log4net\tags\2.0.8RC1\src\Core\LoggingEvent.cs:line 1341
>at log4net.Appender.BufferingAppenderSkeleton.Append(LoggingEvent
> loggingEvent) in c:\log4net\tags\2.0.8RC1\src\Appender\
> BufferingAppenderSkeleton.cs:line 483
>at log4net.Appender.AppenderSkeleton.DoAppend(LoggingEvent
> loggingEvent) in c:\log4net\tags\2.0.8RC1\src\
> Appender\AppenderSkeleton.cs:line 317
> log4net: Shutdown called on Hierarchy [log4net-default-repository]
>
> If we revert back to Log4Net v1.2.13.0, we start receiving emails as
> expected. Please advise how can we resolve the issue with version 2.0.8.
>
>
> Thanks and Regards
>
> Mohkam Singh
>
>


Re: add to log4net-user and log4net-dev mailing lists

2019-09-02 Thread Dominik Psenner
Hi,

The mailing list bot allows you to subscribe and unsubscribe by yourself,
see https://logging.apache.org/log4net/mail-lists.html for
further information.

Shortly, subscription is as easy as sending an empty email to
dev-subscr...@logging.apache.org.

Cheers
--
Sent from my phone. Typos are a kind gift to anyone who happens to find
them.

On Tue, Aug 27, 2019, 20:53 Brown, Michael A  wrote:

> Please add me to log4net-user and log4net-dev mailing lists.
>
>
>
> Thanks.
>
>
>
>
>
> Michael Brown
>
> Lead Software Systems Engineer
>
> Purdue University ITaP
>
> 128 Memorial Mall (STEW B031A)
>
> West Lafayette, IN  47907-2034
>
>
>


Re: Next Release of Log4Net

2019-11-29 Thread Dominik Psenner
There is nobody working neither on a release, nore on netstandard 2.0
support. Get involved! Contributions of any form are welcome!
--
Sent from my phone. Typos are a kind gift to anyone who happens to find
them.

On Mon, Nov 18, 2019, 17:16 Waeckers, Jan-Malte <
jan-malte.waeck...@homag.com> wrote:

> Hello everybody,
>
>
>
> When will the next version of Log4Net be released?
>
> In my opinion this version needs to support .Net Standard 2.0 as target
> framework. Will this be given then?
>
>
>
>
>


Re: Next Release of Log4Net

2019-12-01 Thread Dominik Psenner
It is not only about recompiling, but rather working on the codebase such
that all the parts (appenders, configuration, ..) work and integrate well
into netstandard based applications like aspnetcore work and behave. This
may also mean a large refactor into multiple assemblies, adding support for
json configuration files, support dependency injection apis, ..

--
Sent from my phone. Typos are a kind gift to anyone who happens to find
them.

On Sat, Nov 30, 2019, 15:13 Javier Sanchez  wrote:

> What are the issues to work to recompile to .net standard?
>
>
>
> El vie., 29 nov. 2019 a las 14:35, Dominik Psenner ()
> escribió:
>
>> There is nobody working neither on a release, nore on netstandard 2.0
>> support. Get involved! Contributions of any form are welcome!
>> --
>> Sent from my phone. Typos are a kind gift to anyone who happens to find
>> them.
>>
>> On Mon, Nov 18, 2019, 17:16 Waeckers, Jan-Malte <
>> jan-malte.waeck...@homag.com> wrote:
>>
>>> Hello everybody,
>>>
>>>
>>>
>>> When will the next version of Log4Net be released?
>>>
>>> In my opinion this version needs to support .Net Standard 2.0 as target
>>> framework. Will this be given then?
>>>
>>>
>>>
>>>
>>>
>>


Re: Old Key support for. 2.0.12

2021-08-28 Thread Dominik Psenner
Hi,

as far as I know there is no maintainer that could create binaries signes
with the old key.

Warm regards,
Dominik
--
Sent from my phone. Typos are a kind gift to anyone who happens to find
them.

On Wed, Jul 14, 2021, 11:56 Rasa Mazutiene 
wrote:

> Hi,
> would it be possible to release a 2.0.12 release with an old key?
> We’re dependent on a third party libraries and are unable to upgrade
> log4net for our project otherwise and we need an official version of
> log4net.
> Any support or answer would be highly appreciated.
>
>


  1   2   >