开发者

Change log file name during runtime - ent lib

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 envi开发者_C百科ronment variables. I will set the log name according to the client id.

Thanks Avi


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜