Hi,
We have been using Log4Net to log errors and exception in my application, its a pretty huge project, and I know the messages are logged Asynchronously, but for a few cases the method and message that is getting logged is empty,
Ex : Date:09-05-2012 22:16:13,Level:ERROR,Message:,Method:MonitorTimer,ClassName:ABC.DEF.BO.SchedulerBO.Scheduler,Parameters:,User:Admin,
The Message is empty, parameters are empty.
When I analysed the code, there is no copex code written, all that is there is just a catch block to handle exception inside which the exception is logged. The message is nothing but 'ex.Message',
does any1 have even a slightest idea of what could be leading to this problem.
Thanks in advance.

This is the catch block which is logged as explained in the above code.

 catch (Exception ex)
                {
                    // Log the error to file
                    MessageBusLogger.LogError("MonitorTimer", LogWriter.Level.ERROR,
                      ex.Message, ex.InnerException, "", ToString());
                }

Can you tell the exception type?

Is there any spot in the code that intentionally throws its own exceptions.
Maybe the code is throwing a false exception causing the message to be empty.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.