|
List Info
Thread: Multiple Loggers Stepping on Toes
|
|
| Multiple Loggers Stepping on Toes |

|
2008-06-04 08:54:00 |
I'm working with a 3rd party component that is using
Log4net. Their logger
is configured programatically.
My homegrown components use Log4Net as well and are
configured using a
seperate XML file. As soon as I access a certain line of
code in the 3rd
party component, my logger gets its Debug and Info logging
disabled.
I'm confused how this is happening. I'm getting a log by
totally different
name. Anyone ever see this or know how to fix it?
--
View this message in context: http://www.nabble.com/Multiple-L
oggers-Stepping-on-Toes-tp17647324p17647324.html
Sent from the Log4net - Users mailing list archive at
Nabble.com.
|
|
| Question about RollingLogFileAppender |

|
2008-06-04 12:13:47 |
Currently I have RollingLogFileAppender configured to hold a
max of 20 files PER HOUR as follows:
<appender name="RollingLogFileAppender"
type="log4net.Appender.RollingFileAppender">
<file value="c:logsMyService.log"
/>
<appendToFile value="true" />
<rollingStyle value="Composite" />
<maxSizeRollBackups value="20" />
<maximumFileSize value="100KB" />
<datePattern value="yyyyMMdd-HH" />
....
</appender>
This configuration keeps last 20 files FOR EACH HOUR and
hence the number of files add up indefinitely over time.
Is there a way to configure a absolute max number of total
files (without regards to the rolling intervals)? I am
looking to setup log4net to basically keep a max of last X
number of files at any given point in time in the year or
years.
Regards
Pranav
|
|
| Re: Question about
RollingLogFileAppender |

|
2008-06-04 12:56:11 |
|
Not built into the RollingLogFileAppender.. There may be a hook if you want to extend it.. You'd want to make sure your cleanup wasn't done in the logging thread though, else it will hold up your application processing (and possibly your gui thread)
We have a separate method within our apps that remove log files older than XX days every time the app is started.. You could do something similar by having a timer fire every hour giving you a point to do your cleanup.. And you'd probably want to sort by modified date, getting rid of the oldest ones.. parsing the file names to determine the same would probably be annoying.
I'm not going to ask why 20 x 100kb files per hour though.. we do one file per day ourselves..
-Peter
On Wed, Jun 4, 2008 at 1:13 PM, Pranav Varia < Pranav.Var ia microsoft.com">Pranav.Varia microsoft.com> wrote:
Currently I have RollingLogFileAppender configured to hold a max of 20 files PER HOUR as follows:
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
<file value="c:logsMyService.log" />
<appendToFile value="true" />
<rollingStyle value="Composite" />
<maxSizeRollBackups value="20" />
<maximumFileSize value="100KB" />
<datePattern value="yyyyMMdd-HH" />
....
</appender>
This configuration keeps last 20 files FOR EACH HOUR and hence the number of files add up indefinitely over time.
Is there a way to configure a absolute max number of total files (without regards to the rolling intervals)? I am looking to setup log4net to basically keep a max of last X number of files at any given point in time in the year or years.
Regards
Pranav
-- Peter';s Photography www.PeterDrier.com
|
| log4view equivalent |

|
2008-06-05 05:51:14 |
|
| Hi,
I'm in awe of log4net, nice one! One of the
reasons I digg this utility is because I discovered yesterday that we can
monitor logging remotely via UDP. I configured a UDP appender for our app and
I'm watching production for one of the users on my machine. Neat.
Right now I'm running with an evaluation version of
log4view. I like the colour (ah the simple things in life) and I like the udp
support. However its going to expire in the future and I have limited
functionality. Can anybody tell me a completely free equivalent. Again, the
colour is important.I don't think the log4net from apache supports colour.
sounds silly but our 3rd party dlls spew an awful lot of stuff out and I need to
see it all... can't filter out certain level messages.
thanks much and have a nice day
Graham
|
| RE: log4view equivalent |

|
2008-06-05 08:24:10 |
You can receive UDP events generated by log4net using
log4j's Chainsaw.
You can also search, colorize, sort and filter events with
Chainsaw.
You do need to change your log4net configuration to specify
the log4j schema layout, and specify a UDPReceiver on the
Chainsaw side.
http://
logging.apache.org/chainsaw/index.html
Scott Deboy
COMOTIV SYSTEMS
111 SW Columbia Street Ste. 950
Portland, OR 97201
Telephone: 503.224.7496
Cell: 503.997.1367
Fax: 503.222.0185
sdeboy comotivsystems.com
www.comotivsystems.com
-----Original Message-----
From: Graham Walsh [mailto:graham.walsh-prestataire calyon.com]
Sent: Thu 6/5/2008 3:51 AM
To: Log4NET User
Subject: log4view equivalent
Hi,
I'm in awe of log4net, nice one! One of
the reasons I digg this
utility is because I discovered yesterday that we can
monitor logging
remotely via UDP. I configured a UDP appender for our app
and I'm
watching production for one of the users on my machine.
Neat.
Right now I'm running with an evaluation version of
log4view. I like the
colour (ah the simple things in life) and I like the udp
support.
However its going to expire in the future and I have
limited
functionality. Can anybody tell me a completely free
equivalent. Again,
the colour is important.I don't think the log4net from
apache supports
colour. sounds silly but our 3rd party dlls spew an awful
lot of stuff
out and I need to see it all... can't filter out certain
level messages.
thanks much and have a nice day
Graham
|
|
|
| RE: log4view equivalent |

|
2008-06-05 08:48:05 |
Nice one ,
Thanks Scott.
G
-----Original Message-----
From: Scott Deboy [mailto:sdeboy comotivsystems.com]
Sent: Thursday, June 05, 2008 3:24 PM
To: Log4NET User
Subject: RE: log4view equivalent
You can receive UDP events generated by log4net using
log4j's Chainsaw.
You can also search, colorize, sort and filter events with
Chainsaw.
You do need to change your log4net configuration to specify
the log4j
schema layout, and specify a UDPReceiver on the Chainsaw
side.
http://
logging.apache.org/chainsaw/index.html
Scott Deboy
COMOTIV SYSTEMS
111 SW Columbia Street Ste. 950
Portland, OR 97201
Telephone: 503.224.7496
Cell: 503.997.1367
Fax: 503.222.0185
sdeboy comotivsystems.com
www.comotivsystems.com
-----Original Message-----
From: Graham Walsh [mailto:graham.walsh-prestataire calyon.com]
Sent: Thu 6/5/2008 3:51 AM
To: Log4NET User
Subject: log4view equivalent
Hi,
I'm in awe of log4net, nice one! One of
the reasons I digg this
utility is because I discovered yesterday that we can
monitor logging
remotely via UDP. I configured a UDP appender for our app
and I'm
watching production for one of the users on my machine.
Neat.
Right now I'm running with an evaluation version of
log4view. I like the
colour (ah the simple things in life) and I like the udp
support.
However its going to expire in the future and I have
limited
functionality. Can anybody tell me a completely free
equivalent. Again,
the colour is important.I don't think the log4net from
apache supports
colour. sounds silly but our 3rd party dlls spew an awful
lot of stuff
out and I need to see it all... can't filter out certain
level messages.
thanks much and have a nice day
Graham
Ce message et ses pièces jointes (le "message")
est destiné à l'usage
exclusif de son destinataire.
Si vous recevez ce message par erreur, merci d'en aviser
immédiatement
l'expéditeur et de le détruire ensuite. Le présent message
pouvant
être altéré à notre insu, CALYON Crédit Agricole CIB
ne peut pas être engagé par son contenu. Tous droits
réservés.
This message and/or any attachments (the
"message") is intended for
the sole use of its addressee.
If you are not the addressee, please immediately notify the
sender and
then destroy the message. As this message and/or any
attachments may
have been altered without our knowledge, its content is
not legally
binding on CALYON Crédit Agricole CIB. All rights reserved.
|
|
| AW: log4view equivalent |

|
2008-06-05 10:08:44 |
|
Hi Graham,
nice to hear that you like Log4View!
You are right, the trial edition of Log4View runs out after 30
days. However Log4View continues working as Community Edition. The sole
limitation of the Community Edition is the limit to one receiver. All other
functionality is not affected.
Kind regards
Ulrich Proeller
www.log4view.com
Von: Graham Walsh
[mailto:graham.walsh-prestataire calyon.com]
Gesendet: Donnerstag, 5. Juni 2008 12:51
An: Log4NET User
Betreff: log4view equivalent
Hi,
I'm in awe of log4net, nice one! One of the reasons I digg
this utility is because I discovered yesterday that we can monitor logging
remotely via UDP. I configured a UDP appender for our app and I'm watching
production for one of the users on my machine. Neat.
Right now I'm running with an evaluation version of log4view. I
like the colour (ah the simple things in life) and I like the udp support.
However its going to expire in the future and I have limited functionality. Can
anybody tell me a completely free equivalent. Again, the colour is important.I
don't think the log4net from apache supports colour. sounds silly but our
3rd party dlls spew an awful lot of stuff out and I need to see it all... can't
filter out certain level messages.
thanks much and have a nice day
Graham
|
| RE: log4view equivalent |

|
2008-06-05 10:17:25 |
|
Ah thanks so much Ulrich.
I actually prefer it to be honest, a simple matter of look and feel, etc etc.
Graham
From:
Ulrich J. Proeller [mailto:Ulrich.Proeller prosa-gmbh.de]
Sent: Thursday, June 05, 2008 5:09
PM
To: Log4NET User
Subject: AW: log4view equivalent
Hi Graham,
nice to hear that
you like Log4View!
You are right, the
trial edition of Log4View runs out after 30 days. However Log4View continues
working as Community Edition. The sole limitation of the Community Edition is
the limit to one receiver. All other functionality is not affected.
Kind
regards
Ulrich
Proeller
www.log4view.com
Von: Graham
Walsh [mailto:graham.walsh-prestataire calyon.com]
Gesendet: Donnerstag, 5. Juni 2008
12:51
An: Log4NET User
Betreff: log4view equivalent
Hi,
I'm in awe of log4net,
nice one! One of the reasons I digg this utility is because I
discovered yesterday that we can monitor logging remotely via UDP. I configured
a UDP appender for our app and I'm watching production for one of the users on
my machine. Neat.
Right now I'm running
with an evaluation version of log4view. I like the colour (ah the simple things
in life) and I like the udp support. However its going to expire in the future
and I have limited functionality. Can anybody tell me a completely free
equivalent. Again, the colour is important.I don't think the log4net from
apache supports colour. sounds silly but our 3rd party dlls spew an awful lot
of stuff out and I need to see it all... can't filter out certain level
messages.
thanks much and have a
nice day
Graham
|
| Re: Multiple Loggers Stepping on Toes |
  United States |
2008-06-05 11:06:59 |
Thanks alot. This is just what I needed. Works like a
champ.
corey
Ron Grabowski wrote:
>
> A logger is created from and writes to logger
repository
> (ILoggerRepository). By default there is usually one
logging repository
> per application. Since the 3rd party library has
"corrupted" the default
> repository you can create your own repository and
create loggers from
> there. The repository must have a name. The log4net
test cases normally
> use a guid for their name:
>
> ILoggerRepository rep =
>
LogManager.CreateRepository(Guid.NewGuid().ToString());
>
> You need to tell the XmlConfigurator that you want to
configure your
> specific repository instead of the default repository:
>
> XmlConfigurator.Configure(rep, new
FileInfo("log4net.config"));
>
> When you request a logger you must now pass the name of
the repository
> that you want to create it from:
>
> ILog log = LogManager.GetLogger(rep.Name,
typeof(Program));
>
> You could probably write your own helper method
somewhere in your
> application so that your logger creation code looks
like this:
>
> ILog log = GetLogger(typeof(Program));
>
> Here's a design that a 3rd party library could use to
mimic the familiar
> design of log4net without actually referencing a
particular version of
> log4net and/or without using log4net at all (i.e.
someone could write a
> ConsoleLoggerFactory):
>
> public static class LogManager
> {
> public static ILog GetLogger( Type type )
> {
> return Adapter.GetLogger( type );
> }
>
> public static ILog GetLogger( string name )
> {
> return Adapter.GetLogger(name);
> }
>
> public static ILoggerFactoryAdapter Adapter = new
NullLoggerFactory();
> }
>
> public interface ILoggerFactoryAdapter
> {
> ILog GetLogger(Type type);
> ILog GetLogger(string name);
> }
>
> public interface ILog
> {
> void Debug(object message);
> void Debug(object message, Exception exception);
> bool IsDebugEnabled { get; }
> // snip
> }
>
> ----- Original Message ----
> From: nagooc <coreycoogan yahoo.com>
> To: log4net-user logging.apache.org
> Sent: Wednesday, June 4, 2008 9:54:00 AM
> Subject: Multiple Loggers Stepping on Toes
>
>
> I'm working with a 3rd party component that is using
Log4net. Their
> logger
> is configured programatically.
>
> My homegrown components use Log4Net as well and are
configured using a
> seperate XML file. As soon as I access a certain line
of code in the 3rd
> party component, my logger gets its Debug and Info
logging disabled.
>
> I'm confused how this is happening. I'm getting a log
by totally
> different
> name. Anyone ever see this or know how to fix it?
> --
> View this message in context:
> http://www.nabble.com/Multiple-L
oggers-Stepping-on-Toes-tp17647324p17647324.html
> Sent from the Log4net - Users mailing list archive at
Nabble.com.
>
>
--
View this message in context: http://www.nabble.com/Multiple-L
oggers-Stepping-on-Toes-tp17647324p17673633.html
Sent from the Log4net - Users mailing list archive at
Nabble.com.
|
|
[1-9]
|
|