RE: Can we write the data to Multiple log
Without sounding contrite, I think the group provided guidance to you yesterday on how to do this? The suggestions were to either configure two rolling file appenders or log to a DB. Why do you need to include anything in your UI? This is only my position on this, but - why do you want to specify which log you want to use in the UI? Doesnt this reduce the value of your logging by quite some degree? Subject: RE: Can we write the data to Multiple log Date: Tue, 18 Aug 2009 12:13:53 +0530 From: raghuram.raicho...@accenture.com To: log4net-user@logging.apache.org Hi, From the UI how can I specify the details to which appender to use. My requirement is like there will be two log: - Complete Information, which contains data along with the stack trace and many more parameters coming from the exception - Simple information saying “There was a error with code and simple details” And in this case I need to log them in two different logs at a time. Can you please send me the samples. Thanks in advance. Regards, Raghuram Raichooti From: Ron Grabowski [mailto:rongrabow...@yahoo.com] Sent: Tuesday, August 18, 2009 7:06 AM To: Log4NET User Subject: Re: Can we write the data to Multiple log Does this example help? ?xml version=1.0 encoding=utf-8 ? log4net appender name=SimpleLayoutFileAppender type=log4net.Appender.FileAppender file value=Logs\Simple.txt / layout type=log4net.Layout.SimpleLayout / /appender appender name=PatternLayoutFileAppender type=log4net.Appender.FileAppender file value=Logs\PatternLayout.txt / layout type=log4net.Layout.PatternLayout conversionPattern value=%5level %date (%logger:%line) - %message%newline / /layout /appender root appender-ref ref=SimpleLayoutFileAppender / appender-ref ref=PatternLayoutFileAppender / /root /log4net From: raghuram.raicho...@accenture.com raghuram.raicho...@accenture.com To: log4net-user@logging.apache.org Sent: Monday, August 17, 2009 4:16:42 AM Subject: Can we write the data to Multiple log Hi, I am using the Rolling File Appender, and in this I would like to write the exception raised to two different logs one with simple information and other with the complete information. In the config file I have two sections defining the paths. ?xml version=1.0 standalone=yes ? SYSTEMINFORMATION SYSTEMIDDIS/SYSTEMID ERRORCODELISTPATH/config/errorCode.xml/ERRORCODELISTPATH /SYSTEMINFORMATION APPENDER MODE=tivoli NAME=RollingLogFileAppender TYPE=log4net.Appender.RollingFileAppender FILENAME VALUE=d://svr_app_prod//logs//app_logs//diss//tivoli.log / APPENDTOFILE VALUE=true / ROLLINGSTYLE VALUE=Size / MAXROLLBACKUPSIZE VALUE=10 / MAXFILESIZE VALUE=10MB / MAXENTRIESPERSECOND VALUE=10 / STATICLOGFILENAME VALUE=true / LAYOUT TYPE=log4net.Layout.PatternLayout CONVERSIONPATTERN VALUE=%date [%thread] %-5level %logger [%property{ndc}] - %message%newline / /LAYOUT /APPENDER APPENDER MODE=application NAME=RollingLogFileAppender TYPE=log4net.Appender.RollingFileAppender FILENAME VALUE=d://svr_app_prod//logs//app_logs//diss//application.log / APPENDTOFILE VALUE=true / ROLLINGSTYLE VALUE=Size / MAXROLLBACKUPSIZE VALUE=50 / MAXFILESIZE VALUE=50MB / MAXENTRIESPERSECOND VALUE=10 / STATICLOGFILENAME VALUE=true / LAYOUT TYPE=log4net.Layout.PatternLayout CONVERSIONPATTERN VALUE=%date [%thread] %-5level %logger [%property{ndc}] - %message%newline / /LAYOUT /APPENDER /DataSetConfiguration In our application we only mention Log.Debug(“Logging Information”). Could you please tell me how to specify the details of the log file. Regards, Raghuram Raichooti This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. _ Celebrate a decade of Messenger with free winks, emoticons, display pics, and more. http://clk.atdmt.com/UKM/go/157562755/direct/01/
RE: Can we write the data to Multiple log
OK are not suppose to use the DB. Coming to logging. I need to use RollingFileAppenders for both of the Logs. When you say two logs, its one for the Application Developers who needs to get complete information for them to track. And the other log is for the Tivoli server which keeps tracking the information of the logs. And from UI I normally use only one statement saying Private readonly log4net.ILog Log = log4net.logManager.GetLogger() Log.Debug(GetformatedMessage(Application)); Log.Debug(GetformatedMessage(Tivoli)); I was asking you how can we write the information to the different logs. Regards, Raghuram Raichooti From: Karim Bourouba [mailto:kar...@hotmail.com] Sent: Tuesday, August 18, 2009 12:29 PM To: log4net-user@logging.apache.org Subject: RE: Can we write the data to Multiple log Without sounding contrite, I think the group provided guidance to you yesterday on how to do this? The suggestions were to either configure two rolling file appenders or log to a DB. Why do you need to include anything in your UI? This is only my position on this, but - why do you want to specify which log you want to use in the UI? Doesnt this reduce the value of your logging by quite some degree? Subject: RE: Can we write the data to Multiple log Date: Tue, 18 Aug 2009 12:13:53 +0530 From: raghuram.raicho...@accenture.com To: log4net-user@logging.apache.org Hi, From the UI how can I specify the details to which appender to use. My requirement is like there will be two log: - Complete Information, which contains data along with the stack trace and many more parameters coming from the exception - Simple information saying There was a error with code and simple details And in this case I need to log them in two different logs at a time. Can you please send me the samples. Thanks in advance. Regards, Raghuram Raichooti From: Ron Grabowski [mailto:rongrabow...@yahoo.com] Sent: Tuesday, August 18, 2009 7:06 AM To: Log4NET User Subject: Re: Can we write the data to Multiple log Does this example help? ?xml version=1.0 encoding=utf-8 ? log4net appender name=SimpleLayoutFileAppender type=log4net.Appender.FileAppender file value=Logs\Simple.txt / layout type=log4net.Layout.SimpleLayout / /appender appender name=PatternLayoutFileAppender type=log4net.Appender.FileAppender file value=Logs\PatternLayout.txt / layout type=log4net.Layout.PatternLayout conversionPattern value=%5level %date (%logger:%line) - %message%newline / /layout /appender root appender-ref ref=SimpleLayoutFileAppender / appender-ref ref=PatternLayoutFileAppender / /root /log4net From: raghuram.raicho...@accenture.com raghuram.raicho...@accenture.com To: log4net-user@logging.apache.org Sent: Monday, August 17, 2009 4:16:42 AM Subject: Can we write the data to Multiple log Hi, I am using the Rolling File Appender, and in this I would like to write the exception raised to two different logs one with simple information and other with the complete information. In the config file I have two sections defining the paths. ?xml version=1.0 standalone=yes ? SYSTEMINFORMATION SYSTEMIDDIS/SYSTEMID ERRORCODELISTPATH/config/errorCode.xml/ERRORCODELISTPATH /SYSTEMINFORMATION APPENDER MODE=tivoli NAME=RollingLogFileAppender TYPE=log4net.Appender.RollingFileAppender FILENAME VALUE=d://svr_app_prod//logs//app_logs//diss//tivoli.log / APPENDTOFILE VALUE=true / ROLLINGSTYLE VALUE=Size / MAXROLLBACKUPSIZE VALUE=10 / MAXFILESIZE VALUE=10MB / MAXENTRIESPERSECOND VALUE=10 / STATICLOGFILENAME VALUE=true / LAYOUT TYPE=log4net.Layout.PatternLayout CONVERSIONPATTERN VALUE=%date [%thread] %-5level %logger [%property{ndc}] - %message%newline / /LAYOUT /APPENDER APPENDER MODE=application NAME=RollingLogFileAppender TYPE=log4net.Appender.RollingFileAppender FILENAME VALUE=d://svr_app_prod//logs//app_logs//diss//application.log / APPENDTOFILE VALUE=true / ROLLINGSTYLE VALUE=Size / MAXROLLBACKUPSIZE VALUE=50 / MAXFILESIZE VALUE=50MB / MAXENTRIESPERSECOND VALUE=10 / STATICLOGFILENAME VALUE=true / LAYOUT TYPE=log4net.Layout.PatternLayout CONVERSIONPATTERN VALUE=%date [%thread] %-5level %logger [%property{ndc}] - %message%newline / /LAYOUT /APPENDER /DataSetConfiguration In our application we only mention Log.Debug(Logging Information). Could you please tell me how to specify the details of the log file. Regards, Raghuram Raichooti
RE: Can we write the data to Multiple log
I think the point I failed to make is this; in my opinion, handling the logging from the UI is a bad thing, just configure your application to log as soon as it is started. Ron Grabowski sent a good example of how to do what you want to do, to which you replied. Failing that, just include two rolling fille appeneders in your config file set to look at different levels, i.e. everything for the developers and then a different level for everyone else. I think the biggest question here is what have you tried so far and what problems did you encounter? Subject: RE: Can we write the data to Multiple log Date: Tue, 18 Aug 2009 12:42:53 +0530 From: raghuram.raicho...@accenture.com To: log4net-user@logging.apache.org OK are not suppose to use the DB. Coming to logging. I need to use RollingFileAppenders for both of the Logs. When you say two logs, its one for the Application Developers who needs to get complete information for them to track. And the other log is for the Tivoli server which keeps tracking the information of the logs. And from UI I normally use only one statement saying Private readonly log4net.ILog Log = log4net.logManager.GetLogger(“”) Log.Debug(GetformatedMessage(“Application”)); Log.Debug(GetformatedMessage(“Tivoli”)); I was asking you how can we write the information to the different logs. Regards, Raghuram Raichooti From: Karim Bourouba [mailto:kar...@hotmail.com] Sent: Tuesday, August 18, 2009 12:29 PM To: log4net-user@logging.apache.org Subject: RE: Can we write the data to Multiple log Without sounding contrite, I think the group provided guidance to you yesterday on how to do this? The suggestions were to either configure two rolling file appenders or log to a DB. Why do you need to include anything in your UI? This is only my position on this, but - why do you want to specify which log you want to use in the UI? Doesnt this reduce the value of your logging by quite some degree? Subject: RE: Can we write the data to Multiple log Date: Tue, 18 Aug 2009 12:13:53 +0530 From: raghuram.raicho...@accenture.com To: log4net-user@logging.apache.org Hi, From the UI how can I specify the details to which appender to use. My requirement is like there will be two log: - Complete Information, which contains data along with the stack trace and many more parameters coming from the exception - Simple information saying “There was a error with code and simple details” And in this case I need to log them in two different logs at a time. Can you please send me the samples. Thanks in advance. Regards, Raghuram Raichooti From: Ron Grabowski [mailto:rongrabow...@yahoo.com] Sent: Tuesday, August 18, 2009 7:06 AM To: Log4NET User Subject: Re: Can we write the data to Multiple log Does this example help? ?xml version=1.0 encoding=utf-8 ? log4net appender name=SimpleLayoutFileAppender type=log4net.Appender.FileAppender file value=Logs\Simple.txt / layout type=log4net.Layout.SimpleLayout / /appender appender name=PatternLayoutFileAppender type=log4net.Appender.FileAppender file value=Logs\PatternLayout.txt / layout type=log4net.Layout.PatternLayout conversionPattern value=%5level %date (%logger:%line) - %message%newline / /layout /appender root appender-ref ref=SimpleLayoutFileAppender / appender-ref ref=PatternLayoutFileAppender / /root /log4net From: raghuram.raicho...@accenture.com raghuram.raicho...@accenture.com To: log4net-user@logging.apache.org Sent: Monday, August 17, 2009 4:16:42 AM Subject: Can we write the data to Multiple log Hi, I am using the Rolling File Appender, and in this I would like to write the exception raised to two different logs one with simple information and other with the complete information. In the config file I have two sections defining the paths. ?xml version=1.0 standalone=yes ? SYSTEMINFORMATION SYSTEMIDDIS/SYSTEMID ERRORCODELISTPATH/config/errorCode.xml/ERRORCODELISTPATH /SYSTEMINFORMATION APPENDER MODE=tivoli NAME=RollingLogFileAppender TYPE=log4net.Appender.RollingFileAppender FILENAME VALUE=d://svr_app_prod//logs//app_logs//diss//tivoli.log / APPENDTOFILE VALUE=true / ROLLINGSTYLE VALUE=Size / MAXROLLBACKUPSIZE VALUE=10 / MAXFILESIZE VALUE=10MB / MAXENTRIESPERSECOND VALUE=10 / STATICLOGFILENAME VALUE=true / LAYOUT TYPE=log4net.Layout.PatternLayout CONVERSIONPATTERN VALUE=%date [%thread] %-5level %logger [%property{ndc}] - %message%newline / /LAYOUT /APPENDER APPENDER MODE=application NAME=RollingLogFileAppender TYPE=log4net.Appender.RollingFileAppender FILENAME
Re: Adding custom logging properties
Thanks Ron, that looks like it will allow me to populate the Properties collection of the LoggingEvent instance. Then, considering that the actual properties logged will differ per event I guess I would combine this with my custom Layout class. I think that gives me what I need. Thanks again. Ron Grabowski wrote: public class LogManager { public static GetLoggerT() { return new LogEx(LogManager.GetLogger(typeof(T))); } } // untested...I think I'm forgetting a constructor public class LogEx : LogImpl { private readonly static Type declaringType = typeof(LogEx); public void Info(string message, IDictionary properties) { if (IsInfoEnabled) { LoggingEvent loggingEvent = new LoggingEvent( declaringType, Logger.Repository, Logger.Name, Level.Info, message, t); foreach (var entry in properites) { loggingEvent.Properties[entry.Key.ToString()] = entry.Value; } Logger.Log(loggingEvent); } } } http://www.mail-archive.com/log4net-user@logging.apache.org/msg04357.html - Original Message From: AdamTappis adamtap...@hotmail.com To: log4net-user@logging.apache.org Sent: Monday, August 17, 2009 11:08:44 AM Subject: Re: Adding custom logging properties Having a closer look at the documentation, the Properties property of the LoggingEvent class is a PropertiesDictionary which derives from ReadOnlyPropertiesDictionary which menas it can't be written to and hence it's not suitable for my purposes. Any ideas? AdamTappis wrote: Ross, I guess that's why I'm posting here, because I'm trying to devise a pattern and some coding guidelines so that all our applications log consistently. I considered wrapping log4net but all I've read advises against that. So what I'm trying to achieve is an elegant solution that makes the best use of the framework. You're right, I wish to log a collection of Key-Value pairs associated with a given loggin event. e.g. statistics - eventDataduration3ms/durationsize10kb/size/eventData details - eventDatacustomerID3/customerIDorderID10/orderID/eventData The question I'm asking is how best to implement this with log4net? Should I write a wrapper or a helper class that accepts the key-Value pairs collection as a parameter and returns a formattred XML string that then get's logged? Maybe I should be creating a LoggingEvent in code manually, adding the Key-Value pairs to the Properties collection and then using ILog.Logger.Log to actually log the event rather than using Ilog.Info() to log. I could than write a custom layout class that serialises the properties out as an XML string. like I said, I'm not sure and am looking for some disrection. Ideally I would have the following interface available to me: ILog.Info(string message, Dictionary customProperties) and then it would be the configuration that drives how the customProperties are rendered by specifying the approporiate Layout class. That way I could format the customProperties to a file in one way and to a Db as XML etc... without embedding the formatting logic in my code. Ross Hinkley wrote: Adam, How are these properties getting transformed from a logging call to XML? Are you asking if there's a way to modify a custom format on the fly and then turn the custom properties into XML? (I'm thinking of something like appending name-value pairs to the log format and having a custom appender do the XML conversion for you. This doesn't seem terribly elegant.) Maybe I'm over-trivializing, but it seems to me you should be able to use custom properties to take care of your current needs, converting your properties to XML in code, then modifying the ADO appender configuration to handle that property appropriately when the logging database is implemented. I guess another question would be what sorts of things need to be serialized? Are they going to be serialized from a class? -Ross On Mon, Aug 17, 2009 at 8:12 AM, AdamTappis adamtap...@hotmail.com wrote: Hi, I've been evaluating log4net recently with a view to using the framework as a loggin standard for our enterprise applicaption. I see it very easy to extend the framework, however I have some specific logging requirements and I'm not sure what would be the easiest way implement these with minimal coding. At some time in the future, we aim to build a consolidated logging database that will capture logging data from our server application suite. The information that needs to be logged will differ per service/applicaption and to that end I would aim to have a table schema that has the standard logging columns plus a generic XML column (no defined schema) to act as a property bag for custom information associated with a specific event. We don't have time to develop the logging repository at present, however I'm stressing that we should build logging into our
Experiencing locks while using AdoNetAppender
Hi, I am using the AdoNetAppender for logging messages from multiple application. All the applications log into one sqllite database. Sometimes when a lot of information is logged I am experiencing exceptions like: log4net:ERROR [AdoNetAppender] Exception while writing to database System.Data.SQLite.SQLiteException: The database file is locked database is locked at System.Data.SQLite.SQLite3.Reset(SQLiteStatement stmt) at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt) at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery() at System.Data.SQLite.SQLiteTransaction..ctor(SQLiteConnection connection, Boolean deferredLock) at System.Data.SQLite.SQLiteConnection.BeginTransaction(Boolean deferredLock) at System.Data.SQLite.SQLiteConnection.BeginDbTransaction(IsolationLevel isolationLevel) at System.Data.Common.DbConnection.System.Data.IDbConnection.BeginTransacti on() at log4net.Appender.AdoNetAppender.SendBuffer(LoggingEvent[] events) The default CommandTimeout in the AdoNetAppender on the IDbCommand is 30 seconds, but I would like to influence this timeout in the log4net configuration (file) so that I can influence the timeout on the logging if the database is locked for a longer portion of time. Reducing the timeout may lead to events getting lost, but I prefer that to our application hanging for the full CommandTimeout waiting for the database to become unlocked. Is it possible to configure the timeout using configuration? or would it be better to choose for a solution like deriving from the AdoNetAppender and add the functionality? Thanks in advance for any answers. Patrick **DISCLAIMER** Deze E-mail is uitsluitend bestemd voor de geadresseerde(n). Verstrekking aan en gebruik door anderen is niet toegestaan. De Hoogendoorn Groep sluit iedere aansprakelijkheid uit die voortvloeit uit elektronische verzending. This E-mail is intended exclusively for the addressee(s), and may not be passed on to, or made available for use by any person other than the addressee(s). The Hoogendoorn Group rules out any and every liability resulting from any electronic transmission. *** This message has been scanned by Network Associates' McAfee AntiVirus Technology
RE: Experiencing locks while using AdoNetAppender
Hi, I have seen similar behaviour when working with Access. I know this wont help, but I found it to be a limitation of file based databases unfortunately :( Subject: Experiencing locks while using AdoNetAppender Date: Tue, 18 Aug 2009 14:29:17 +0200 From: p...@hoogendoorn.nl To: log4net-user@logging.apache.org Hi, I am using the AdoNetAppender for logging messages from multiple application. All the applications log into one sqllite database. Sometimes when a lot of information is logged I am experiencing exceptions like: log4net:ERROR [AdoNetAppender] Exception while writing to database System.Data.SQLite.SQLiteException: The database file is locked database is locked at System.Data.SQLite.SQLite3.Reset(SQLiteStatement stmt) at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt) at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery() at System.Data.SQLite.SQLiteTransaction..ctor(SQLiteConnection connection, Boolean deferredLock) at System.Data.SQLite.SQLiteConnection.BeginTransaction(Boolean deferredLock) at System.Data.SQLite.SQLiteConnection.BeginDbTransaction(IsolationLevel isolationLevel) at System.Data.Common.DbConnection.System.Data.IDbConnection.BeginTransaction() at log4net.Appender.AdoNetAppender.SendBuffer(LoggingEvent[] events) The default CommandTimeout in the AdoNetAppender on the IDbCommand is 30 seconds, but I would like to influence this timeout in the log4net configuration (file) so that I can influence the timeout on the logging if the database is locked for a longer portion of time. Reducing the timeout may lead to events getting lost, but I prefer that to our application hanging for the full CommandTimeout waiting for the database to become unlocked. Is it possible to configure the timeout using configuration? or would it be better to choose for a solution like deriving from the AdoNetAppender and add the functionality? Thanks in advance for any answers. Patrick **DISCLAIMER** Deze E-mail is uitsluitend bestemd voor de geadresseerde(n). Verstrekking aan en gebruik door anderen is niet toegestaan. De Hoogendoorn Groep sluit iedere aansprakelijkheid uit die voortvloeit uit elektronische verzending. This E-mail is intended exclusively for the addressee(s), and may not be passed on to, or made available for use by any person other than the addressee(s). The Hoogendoorn Group rules out any and every liability resulting from any electronic transmission. *** This message has been scanned by Network Associates' McAfee AntiVirus Technology _ Windows Live Messenger: Celebrate 10 amazing years with free winks and emoticons. http://clk.atdmt.com/UKM/go/157562755/direct/01/
RE: Does log4net support 64-bit Windows environments?
We are running on 64 bit windows here with no problems although our .NET applications are compiled 32-bit (not Any CPU) because they link to 32-bit native DLLs. Which logging appenders are you using? I'm not sure, but some of those might pInvoke out to native code. If the native code that gets invoked is 32-bit, then that will cause something like a BadImageFormatException. You get that exception in the DLL that is referencing the native code though, not the 32-bit native DLL, so it can be hard to track down. It could also be your code that is pInvoking out to 32-bit native DLLs, maybe through 3rd Party components. Personally, I haven't seen any 64-bit issues in .NET programs that weren't related to native interop. Can you describe the issues/exceptions you are seeing? It would be much easier to help you track down the problem. Rob Prouse -Original Message- From: Ron Grabowski [mailto:rongrabow...@yahoo.com] Sent: August-17-09 9:27 PM To: Log4NET User Subject: Re: Does log4net support 64-bit Windows environments? What are the real issues you've found? - Original Message From: kjh_ngisd kjhsd_do...@yahoo.com To: log4net-user@logging.apache.org Sent: Monday, August 17, 2009 11:01:33 AM Subject: RE: Does log4net support 64-bit Windows environments? This post if from a while ago. Has log4net officially supported 64-bit OS's yet? Anyone know? I'm finding some real issues taking my stuff from 32 bit to 64. I've looked on log4net's site and can't see anything about it. I'm still debugging but it's looking more and more like log4net is the problem. Just wondering if anyone has any update on this. --kevin Susan Farley wrote: We've had it in use on our 64 bit machines for around 5 months with no problems; in case that helps. Susan From: jeroenbart.enge...@kpn.com [mailto:jeroenbart.enge...@kpn.com] Sent: Thursday, January 24, 2008 11:09 AM To: log4net-user@logging.apache.org Subject: RE: Does log4net support 64-bit Windows environments? Thanks :-) -- XML is like violence: if it doesn't solve your problem, you aren't using enough of it Jeroen-bart Engelen, Senior software engineer, KPN Wholesale Operations, Service Operations, Ontwikkeling, ISP Diensten Tel:+31(0)30 6588252 E-mail: jeroenbart.enge...@kpn.com From: Dean Fiala [mailto:dfi...@celadonlabs.com] Sent: Thursday, January 24, 2008 17:03 To: 'Log4NET User' Subject: RE: Does log4net support 64-bit Windows environments? That I have no answer for. If it breaks I'll let you know. :) From: jeroenbart.enge...@kpn.com [mailto:jeroenbart.enge...@kpn.com] Sent: Thursday, January 24, 2008 10:44 AM To: log4net-user@logging.apache.org Subject: RE: Does log4net support 64-bit Windows environments? Okay, so it works for you. But I want to know if it's officially supported and thoroughly tested. I just want to make sure it doesn't work for a while and then inexplicitly stops working because of some overflow due to the 64-bitness of the system. -- XML is like violence: if it doesn't solve your problem, you aren't using enough of it Jeroen-bart Engelen, Senior software engineer, KPN Wholesale Operations, Service Operations, Ontwikkeling, ISP Diensten Tel:+31(0)30 6588252 E-mail: jeroenbart.enge...@kpn.com From: Dean Fiala [mailto:dfi...@celadonlabs.com] Sent: Thursday, January 24, 2008 15:13 To: 'Log4NET User' Subject: RE: Does log4net support 64-bit Windows environments? I recently recompiled log4net to a 64-bit version. It compiled and ran without issue under the 64-bit website and service we created. The only compiler warnings generated were for obsolete method calls. Regards, Dean Fiala Chief Technology Officer Celadon Laboratories, Inc. http://www.celadonlabs.com From: jeroenbart.enge...@kpn.com [mailto:jeroenbart.enge...@kpn.com] Sent: Thursday, January 24, 2008 6:02 AM To: log4net-user@logging.apache.org Subject: Does log4net support 64-bit Windows environments? Hello, We are currently planning on moving our .NET applications from Windows 2003 Server 32-bits, to the Windows 2003 Server 64-bits platform and are investigating if our applications can handle the 32 extra bits. We use log4net in all of our applications and when looking through the source I saw a few DLL Imports which could cause a problem. I tried looking on the log4net website and searching with Google, but I didn't find an answer. Can anyone tell me if log4net is able to run in a full 64-bit environment? So not on the 32-bits WOW subsystem, but as a full 64-bits module. Thanks! -- XML is like violence: if it doesn't solve your problem, you aren't using enough of it Jeroen-bart Engelen, Senior software engineer, KPN Wholesale
RE: Can we write the data to Multiple log
I am sorry, I am more than willing to provide help to you, but I dont really have the time to go through all of your code. You sent me an entire project. Can you not just explain what you have done so far and what problems you have faced? I know this sounds bad, but there have been quite a few very good examples of routes you can take with this already posted. Subject: RE: Can we write the data to Multiple log Date: Tue, 18 Aug 2009 19:36:55 +0530 From: raghuram.raicho...@accenture.com To: log4net-user@logging.apache.org; log4net-user@logging.apache.org Hi, Please find the sample example which i am doing. and please suggest me if i did something wrong. Thanks Regards, Raghuram Raichooti From: Karim Bourouba [mailto:kar...@hotmail.com] Sent: Tue 18.08.2009 13:18 To: log4net-user@logging.apache.org Subject: RE: Can we write the data to Multiple log I think the point I failed to make is this; in my opinion, handling the logging from the UI is a bad thing, just configure your application to log as soon as it is started. Ron Grabowski sent a good example of how to do what you want to do, to which you replied. Failing that, just include two rolling fille appeneders in your config file set to look at different levels, i.e. everything for the developers and then a different level for everyone else. I think the biggest question here is what have you tried so far and what problems did you encounter? Subject: RE: Can we write the data to Multiple log Date: Tue, 18 Aug 2009 12:42:53 +0530 From: raghuram.raicho...@accenture.com To: log4net-user@logging.apache.org OK are not suppose to use the DB. Coming to logging. I need to use RollingFileAppenders for both of the Logs. When you say two logs, its one for the Application Developers who needs to get complete information for them to track. And the other log is for the Tivoli server which keeps tracking the information of the logs. And from UI I normally use only one statement saying Private readonly log4net.ILog Log = log4net.logManager.GetLogger() Log.Debug(GetformatedMessage(Application)); Log.Debug(GetformatedMessage(Tivoli)); I was asking you how can we write the information to the different logs. Regards, Raghuram Raichooti From: Karim Bourouba [mailto:kar...@hotmail.com] Sent: Tuesday, August 18, 2009 12:29 PM To: log4net-user@logging.apache.org Subject: RE: Can we write the data to Multiple log Without sounding contrite, I think the group provided guidance to you yesterday on how to do this? The suggestions were to either configure two rolling file appenders or log to a DB. Why do you need to include anything in your UI? This is only my position on this, but - why do you want to specify which log you want to use in the UI? Doesnt this reduce the value of your logging by quite some degree? Subject: RE: Can we write the data to Multiple log Date: Tue, 18 Aug 2009 12:13:53 +0530 From: raghuram.raicho...@accenture.com To: log4net-user@logging.apache.org Hi, From the UI how can I specify the details to which appender to use. My requirement is like there will be two log: - Complete Information, which contains data along with the stack trace and many more parameters coming from the exception - Simple information saying There was a error with code and simple details And in this case I need to log them in two different logs at a time. Can you please send me the samples. Thanks in advance. Regards, Raghuram Raichooti From: Ron Grabowski [mailto:rongrabow...@yahoo.com] Sent: Tuesday, August 18, 2009 7:06 AM To: Log4NET User Subject: Re: Can we write the data to Multiple log Does this example help? ?xml version=1.0 encoding=utf-8 ? log4net appender name=SimpleLayoutFileAppender type=log4net.Appender.FileAppender file value=Logs\Simple.txt / layout type=log4net.Layout.SimpleLayout / /appender appender name=PatternLayoutFileAppender type=log4net.Appender.FileAppender file value=Logs\PatternLayout.txt / layout type=log4net.Layout.PatternLayout conversionPattern value=%5level %date (%logger:%line) - %message%newline / /layout /appender root appender-ref ref=SimpleLayoutFileAppender / appender-ref ref=PatternLayoutFileAppender / /root /log4net From: raghuram.raicho...@accenture.com raghuram.raicho...@accenture.com To:
Re: Out of the office
I've been on the log4net mailing list for years now, and this clown still can't configure his out-of-reply tool correctly. On Tue, Jul 28, 2009 at 11:08 AM, Allen Andersonalbr...@gmail.com wrote: Whatever -Original Message- From: harry.dougl...@pnc.com [mailto:harry.dougl...@pnc.com] Sent: Monday, July 27, 2009 9:21 PM To: Log4NET User Subject: Out of the office I will be out of the office starting 07/27/2009 and will not return until 08/04/2009. I will respond to your message upon my return. If you need immediate assistance, please contact Jim Snyder at (215) 585-6514. Thank you.
Re: Experiencing locks while using AdoNetAppender
I think that's how SQLite works. Have you tried writing to a single .db file from multiple threads without using log4net? From: Patrick Kalkman p...@hoogendoorn.nl To: log4net-user@logging.apache.org Sent: Tuesday, August 18, 2009 8:29:17 AM Subject: Experiencing locks while using AdoNetAppender Experiencing locks while using AdoNetAppender Hi, I am using the AdoNetAppender for logging messages from multiple application. All the applications log into one sqllite database. Sometimes when a lot of information is logged I am experiencing exceptions like: log4net:ERROR [AdoNetAppender] Exception while writing to database System.Data.SQLite.SQLiteException: The database file is locked database is locked at System.Data.SQLite.SQLite3.Reset(SQLiteStatement stmt) at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt) at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery() at System.Data.SQLite.SQLiteTransaction..ctor(SQLiteConnection connection, Boolean deferredLock) at System.Data.SQLite.SQLiteConnection.BeginTransaction(Boolean deferredLock) at System.Data.SQLite.SQLiteConnection.BeginDbTransaction(IsolationLevel isolationLevel) at System.Data.Common.DbConnection.System.Data.IDbConnection.BeginTransaction() at log4net.Appender.AdoNetAppender.SendBuffer(LoggingEvent[] events) The default CommandTimeout in the AdoNetAppender on the IDbCommand is 30 seconds, but I would like to influence this timeout in the log4net configuration (file) so that I can influence the timeout on the logging if the database is locked for a longer portion of time. Reducing the timeout may lead to events getting lost, but I prefer that to our application hanging for the full CommandTimeout waiting for the database to become unlocked. Is it possible to configure the timeout using configuration? or would it be better to choose for a solution like deriving from the AdoNetAppender and add the functionality? Thanks in advance for any answers. Patrick **DISCLAIMER** Deze E-mail is uitsluitend bestemd voor de geadresseerde(n). Verstrekking aan en gebruik door anderen is niet toegestaan. De Hoogendoorn Groep sluit iedere aansprakelijkheid uit die voortvloeit uit elektronische verzending. This E-mail is intended exclusively for the addressee(s), and may not be passed on to, or made available for use by any person other than the addressee(s). The Hoogendoorn Group rules out any and every liability resulting from any electronic transmission. *** This message has been scanned by Network Associates' McAfee AntiVirus Technology
Re: Experiencing locks while using AdoNetAppender
Not sure if this has changed, but I'm pretty sure there is a database lock on inserts/updates. So only one insert at a time. You might try the BufferedForwardingAppender. It might serialize the inserts for you. On Aug 18, 2009, at 8:36 PM, Ron Grabowski rongrabow...@yahoo.com wrote: I think that's how SQLite works. Have you tried writing to a single .db file from multiple threads without using log4net? From: Patrick Kalkman p...@hoogendoorn.nl To: log4net-user@logging.apache.org Sent: Tuesday, August 18, 2009 8:29:17 AM Subject: Experiencing locks while using AdoNetAppender Hi, I am using the AdoNetAppender for logging messages from multiple application. All the applications log into one sqllite database. Sometimes when a lot of information is logged I am experiencing exceptions like: log4net:ERROR [AdoNetAppender] Exception while writing to database System.Data.SQLite.SQLiteException: The database file is locked database is locked at System.Data.SQLite.SQLite3.Reset(SQLiteStatement stmt) at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt) at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery() at System.Data.SQLite.SQLiteTransaction..ctor(SQLiteConnection connection, Boolean deferredLock) at System.Data.SQLite.SQLiteConnection.BeginTransaction(Boolean deferredLock) at System.Data.SQLite.SQLiteConnection.BeginDbTransaction (IsolationLevel isolationLevel) at System.Data.Common.DbConnection.System.Data.IDbConnection.BeginTransaction( ) at log4net.Appender.AdoNetAppender.SendBuffer(LoggingEvent[] events) The default CommandTimeout in the AdoNetAppender on the IDbCommand is 30 seconds, but I would like to influence this timeout in the log4net configuration (file) so that I can influence the timeout on the logging if the database is locked for a longer portion of time. Reducing the timeout may lead to events getting lost, but I prefer that to our application hanging for the full CommandTimeout waiting for the database to become unlocked. Is it possible to configure the timeout using configuration? or would it be better to choose for a solution like deriving from the AdoNetAppender and add the functionality? Thanks in advance for any answers. Patrick **DISCLAIMER** Deze E-mail is uitsluitend bestemd voor de geadresseerde(n). Verstrekking aan en gebruik door anderen is niet toegestaan. De Hoogendoorn Groep sluit iedere aansprakelijkheid uit die voortvloeit uit elektronische verzending. This E-mail is intended exclusively for the addressee(s), and may not be passed on to, or made available for use by any person other than the addressee(s). The Hoogendoorn Group rules out any and every liability resulting from any electronic transmission. *** This message has been scanned by Network Associates' McAfee AntiVirus Technology
asynchronous logging using log4net
Hello, Looking through the archives, I see attempts in the past to add asynchronous logging to log4net, but am not sure if the efforts have gone anywhere. I would appreciate some feedback on how to accomplish what is conceptually a pretty simple task. I would like to do the following: 1) have a logging thread solely responsible for the actual I/O component of logging (in this case, I'm only concerned with logging to console and/or to file). the logging thread would process logging events from some sort of queue 2) a way of having multiple producers append logging events to the logging queue from various producer threads One additional consideration: rendering - I want to be able to control when rendering occurs. Having rendering in the producer threads guarantees that the data rendered is what you actually want to log - assuming you're passing in mutable objects to the logging statements that might change between the time the logging call is made vs. when the logging message is actually rendered. Alternatively, if you are only passing in non-mutable objects or implicitly make the guarantee that nothing will change, rendering the logging message in the logging thread is more efficient. Based on what I want to do and from the googling I've done, I don't believe that writing a custom Appender will do this. Instead, it seems like the way to go is to implement a custom ILog object the proxies Debug / Log / Warn calls by adding the arguments to a queue. However, this is just a guess. Perhaps a better solution already exists. Any help / feedback here would be greatly appreciated. Thanks! Best, John P.S. I accidentally sent this message to the dev thread as well. So my apologies if you see this message there. I didn't mean to spam.