Thursday 15 March 2012

logging - ServiceStack Log Scrubbing -


I am logging all API calls in service stack through the creation of log in mechanism. I am thinking that there is no way to get rid of the logs like blocking the password and clearing the data like password.

You just have your own adapter ILogFactory and ILog classes that currently function as a proxy in the configured logger, for example:

  LogManager. Logfactic = new scrubberlogfactory (LogManager logfactory);   

ScrubberLogFactory will just be a cover and call the actual logfree, e.g.:

  class ScrubberLogFactory: ILogFactory {ILogFactory logFactory; Public ScrubberLogFactory (ILogFactory logFactory) {this.logFactory = logFactory; } Public Alag GetLogger (Type Type) {New ScrubLogger (logfactory.GetLogger (type)); } Public Alag GetLogger (String TypeName) {Return the new scrub logger (logfactory.GetLogger (typeName)); }}   

ScrubLogger is another adapter class that blocks all logging calls that you can then do that you need (ie clear the logging information). >

No comments:

Post a Comment