I am able to work with inbuilt ServiceStack logging api. All I am doing is instantiating the a concrete LogFactory and assigning it on LogManager.LogFactory property in Configure method.
But, I am wondering, if I can inject the LogFactory via configuration (web.config) so that logs destination can be modified. It would help to diagnose the problems in the production environment easily.
is it possible to inject LogFactory via config file?
The safest way to set the LogFactory is before you initialize your AppHost so the
LogManageris initialized before any static class initializers have run (and LogFactory’s assigned). Also there is no specific support forWeb.configbut it’s trivial to do this in code, e.g: