0

I have a WCF service that will serve multiple clients. I'm using ent lib for the logging. I'd like to have a different log file for each client. is there a way to change the file name back and forth? I found a few threads but they all talk about editing the config file during runtime. ALso found this: Enterprise Library Logging but it talks about environment variables. I will set the log name according to the client id.

Thanks Avi

Community
  • 1
  • 1
Avi Harush
  • 989
  • 2
  • 10
  • 15

1 Answers1

0

You can have distinct categories linked to individually configured FlatFile or RollingFile tracelisteners for each client.

If filenames are unknown till runtime, consider using fluent API for configuration, like so: http://msdn.microsoft.com/en-us/library/ff664363(PandP.50).aspx#fluent_api_logging

Grigori Melnik
  • 4,067
  • 2
  • 34
  • 40
  • Categories are not good. Let's say I serve humans. every request comes from a person with an id. I want the session that served the person to write a log with the user id as the file name. every request will end up with a unique file name. there will never be 2 of the same name. Hope it helps. Avi – Avi Harush Sep 14 '11 at 08:44
  • Ok, have yoiu tried my other suggestion of programmatically configuring your tracelisteners? – Grigori Melnik Sep 18 '11 at 02:30