maoyuan121 / elmah

Automatically exported from code.google.com/p/elmah
Apache License 2.0
0 stars 0 forks source link

Programmatic configuration of default error log #149

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What new or enhanced feature are you proposing?

Allow the default error log to be set-up programmatically rather than only 
via theconfiguration file as is the case right now.

What goal would this enhancement help you achieve?

It would enable scenarios where the log must be dynamically configured at 
run-time or based on the context.

See also a case for SQL Azure:
http://groups.google.com/group/elmah/msg/73e57b8fe9b89007

Currently, this requires hacks at best, as shown here:
http://groups.google.com/group/elmah/msg/4d6b05077dee1e0c

Original issue reported on code.google.com by azizatif on 8 Jan 2010 at 7:55

GoogleCodeExporter commented 9 years ago

Original comment by azizatif on 8 Jan 2010 at 8:04

GoogleCodeExporter commented 9 years ago

Original comment by azizatif on 9 Jan 2010 at 5:28

GoogleCodeExporter commented 9 years ago
Implemented in r698.

There is a new class called ServiceCenter. Assign a new implementation of 
ServiceProvideQueryHandler to its Current property. The method represented by 
ServiceProvideQueryHandler should then return a class that implements 
IServiceProvider. ELMAH will call this class to request the ErrorLog. That 
ErrorLog 
can then be programatically configured.

Original comment by azizatif on 9 Jan 2010 at 7:33

GoogleCodeExporter commented 9 years ago

Original comment by azizatif on 9 Jan 2010 at 7:33

GoogleCodeExporter commented 9 years ago
Doesn't seem to work with the XmlFileErrorLog.
It calls the IServiceProvider as it should and I return the configured 
XmlFileErrorLog instance set to the same as if it was set and created using the 
Web.Config, but it never write any logs.

Original comment by superlyn...@gmail.com on 3 Jun 2012 at 2:08

GoogleCodeExporter commented 9 years ago
@superlynhurtig This is a closed feature issue. If you think you have found a 
bug, please report it as a new issue with as many details as you can share 
about your setup and why you think it is bug.

Original comment by azizatif on 3 Jun 2012 at 4:33