-
-
Save Azerothian/807209 to your computer and use it in GitHub Desktop.
This file contains hidden or 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> | |
/// Make the new nHibernate Manager Object | |
/// </summary> | |
public Manager() | |
{ | |
// Setup Logging | |
log4net.Appender.FileAppender appender = new log4net.Appender.FileAppender(); | |
appender.File = @".\logs\data-manager.log"; | |
appender.LockingModel = new log4net.Appender.FileAppender.MinimalLock(); | |
appender.ImmediateFlush = true; | |
// Logging Pattern & Layout | |
string pattern = "%timestamp, %thread, %level, %logger, %ndc,%message %newline"; | |
log4net.Layout.PatternLayout pl = new log4net.Layout.PatternLayout(pattern); | |
appender.Layout = pl; | |
appender.ActivateOptions(); | |
appender.Threshold = log4net.Core.Level.Verbose; | |
log4net.Config.BasicConfigurator.Configure(appender); | |
// Setup nHibernate Configuration | |
_config = new Configuration(); | |
_config.Configure(@".\config\hibernate.cfg.xml"); | |
if (_config == null) | |
{ | |
throw new InvalidOperationException("NHibernate configuration is null."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment