Layer Level Logging
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// possible layers | |
/// </summary> | |
public abstract class LayerDefinitions | |
{ | |
public static string ServiceHostLayer { get { return "Sample.Service.Host"; } } | |
public static string ServiceRepositorylayer { get { return "Sample.Service.Repository"; } } | |
public static string CommonRepositorylayer { get { return "Sample.Common.Repository"; } } | |
public static string DataAccessLayer { get { return "Sample.DataAccess"; } } | |
public static string WebSecurityLayer { get { return "Sample.WebSecurity"; } } | |
public static string CoreLayer { get { return "Sample.Core"; } } | |
public static string UtilLayer { get { return "Sample.Util"; } } | |
} | |
/// <summary> | |
/// loging library : Log4net | |
/// </summary> | |
public class LoggerService | |
{ | |
public static log4net.ILog Log | |
{ | |
get | |
{ | |
return log4net.LogManager | |
.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | |
} | |
} | |
public static void Setup(HttpContext context) | |
{ | |
string path = context.Server.MapPath("log4net.config"); | |
if (File.Exists(path)) | |
{ | |
log4net.Config.XmlConfigurator.ConfigureAndWatch(new FileInfo(path)); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment