I am using log4net
in an enterprise system, the system have three tiers:
The layers talk each other via WCF (wsHttpBinding
) and in each layer there is a log file.
When I run a test workflow, each tier executed his job but the logger did not write anything.
Any ideas?
Here are a few ideas:
In each tier, do you have a call to log4net.Config.XmlConfigurator.Configure(...)
? In most cases, people use an assembly attribute to do this in the AssemblyInfo.cs/Program.cs/Global.asax.cs/etc. but you can also just call it somewhere in your application startup routine.
See this page ("When should I log my first message"): http://logging.apache.org/log4net/release/faq.html
If you are using file-based logging, where are you trying to store the log files? - does the target directory exist, and does the user account that is running the tier have write permission to that folder? For web apps, the user account is the App Pool identity, and for Windows Services, the user account is the Login that runs the service. For console and windows apps, the user account may be the user that launches the app.
If all else fails you can turn on log4net internal debugging which might help: http://logging.apache.org/log4net/release/faq.html ("How do I enable log4net internal debugging")