Skip to content

Instantly share code, notes, and snippets.

@yemrekeskin
Created May 20, 2013 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yemrekeskin/5613861 to your computer and use it in GitHub Desktop.
Save yemrekeskin/5613861 to your computer and use it in GitHub Desktop.
Layer Level Logging
/// <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