I've got a problem with my relatively complex service-based application.
Here is the structure and desired logging results of the entire application:
1. A service watches serial port traffic, builds message responses, and
changes data in a DLL.
The service should maintain its own [shared] log4net log.
2. The DLL is the main database for the service. I want the DLL to write
to the same shared log4net log as the service.
3. There is another DLL that is a sub-component of the main DLL. It
maintains its own info, and has its own serial port connection to
communicate on. I want this sub-DLL to maintain its own separate log4net
logfile.
------------
1. I am currently setting up the service's log4net file like this (VB.NET):
Public ReadOnly log As ILog =
log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod()
.DeclaringType)
2. The main DLL's logfile (shared with the service) is set up as follows
(VB.NET):
Public Shared ReadOnly log As ILog =
log4net.LogManager.GetLogger(System.Reflection.Assembly.GetEntryAssembly().G
etName().ToString())
3. The sub-component DLL with the separate log is set up as follows (C#):
private readonly ILog log =
log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod()
.DeclaringType);
------------
Here is the result that I am getting (which is not what I want):
1. The service writes to its logfile correctly until the main DLL (and in
turn the sub-component DLL) is created. Then the service writes only to the
sub-component DLL's logfile.
2. The main DLL isn't writing anywhere.
3. The sub-component DLL is writing correctly to its logfile.
-----------
Any help or advice anyone can offer on correctly setting up separate
logfiles for multiple layers of classes/assemblies/DLLs, I would very much
appreciate it.
Thank you very much!
Chris