I have a REST-webservice that always is called this way:
http://rest.company.com/rest/path/?SPHostUrl=www.origin.com
http://rest.company.com/rest/path/?SPHostUrl=www.anotherorigin.com
I want to be able to create different log files for each origin from the SPHostUrl-Parameter of the HttpContext.
Just assume a HtttpContext is always available when I log.
The golden solution would be to have logfiles like:
applicationlog.origin.log
and applicationlog.anotherorigin.log
Is it possible to do this using a custom RollingFileAppender?
If this is not possible:
Is there a way I can automatically add the url as part of the patternlayout without having to modify every Log.Debug()
, etc. lines?
(note) The SPHostUrl is quite dynamic. Currently about 10 different origins and this can change. So creating an appender for each origin in the Web.Config is not an option for me.