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
10 changes: 5 additions & 5 deletions src/NHibernate/Logging.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@ private static ILoggerFactory GetLoggerFactory(string nhibernateLoggerClass)
var loggerFactoryType = System.Type.GetType(nhibernateLoggerClass);
try
{
loggerFactory = (ILoggerFactory) Activator.CreateInstance(loggerFactoryType);
loggerFactory = (ILoggerFactory)Activator.CreateInstance(loggerFactoryType);
}
catch (MissingMethodException ex)
{
throw new ApplicationException("Public constructor was not found for " + loggerFactoryType, ex);
}
catch (InvalidCastException ex)
{
throw new ApplicationException(loggerFactoryType + "Type does not implement " + typeof (ILoggerFactory), ex);
throw new ApplicationException(loggerFactoryType + "Type does not implement " + typeof(ILoggerFactory), ex);
}
catch (Exception ex)
{
Expand All @@ -87,9 +87,9 @@ private static string GetNhibernateLoggerClass()
string binPath = relativeSearchPath == null ? baseDir : Path.Combine(baseDir, relativeSearchPath);
string log4NetDllPath = binPath == null ? "log4net.dll" : Path.Combine(binPath, "log4net.dll");

if (File.Exists(log4NetDllPath))
if (File.Exists(log4NetDllPath) || AppDomain.CurrentDomain.GetAssemblies().Any(a => a.GetName().Name == "log4net"))
{
nhibernateLoggerClass = typeof (Log4NetLoggerFactory).AssemblyQualifiedName;
nhibernateLoggerClass = typeof(Log4NetLoggerFactory).AssemblyQualifiedName;
}
}
else
Expand Down Expand Up @@ -138,7 +138,7 @@ public class NoLoggingInternalLogger: IInternalLogger
{
public bool IsErrorEnabled
{
get { return false;}
get { return false; }
}

public bool IsFatalEnabled
Expand Down