Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions src/NHibernate/Logging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;

namespace NHibernate
{
Expand Down Expand Up @@ -81,16 +82,13 @@ private static string GetNhibernateLoggerClass()
string nhibernateLoggerClass = null;
if (string.IsNullOrEmpty(nhibernateLogger))
{
// look for log4net.dll
string baseDir = AppDomain.CurrentDomain.BaseDirectory;
string relativeSearchPath = AppDomain.CurrentDomain.RelativeSearchPath;
string binPath = relativeSearchPath == null ? baseDir : Path.Combine(baseDir, relativeSearchPath);
var log4NetDllPath = Path.Combine(binPath, "log4net.dll");

if (File.Exists(log4NetDllPath))
try
{
nhibernateLoggerClass = typeof (Log4NetLoggerFactory).AssemblyQualifiedName;
// look for log4net.dll
Assembly.Load("log4net");
nhibernateLoggerClass = typeof(Log4NetLoggerFactory).AssemblyQualifiedName;
}
catch { }
}
else
{
Expand Down