1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle
.Core
.Logging
.Factories
21 public abstract class AbstractExtendedLoggerFactory
: IExtendedLoggerFactory
23 public abstract class AbstractExtendedLoggerFactory
: MarshalByRefObject
, IExtendedLoggerFactory
26 #region IExtendedLoggerFactory Members
29 /// Creates a new extended logger, getting the logger name from the specified type.
31 public virtual IExtendedLogger
Create(Type type
)
33 if (type
== null) throw new ArgumentNullException("type");
35 return Create(type
.FullName
);
39 /// Creates a new extended logger.
41 public abstract IExtendedLogger
Create(string name
);
44 /// Creates a new extended logger, getting the logger name from the specified type.
46 public virtual IExtendedLogger
Create(Type type
, LoggerLevel level
)
48 if (type
== null) throw new ArgumentNullException("type");
50 return Create(type
.FullName
, level
);
54 /// Creates a new extended logger.
56 public abstract IExtendedLogger
Create(string name
, LoggerLevel level
);
60 #region ILoggerFactory Members
63 /// Creates a new logger, getting the logger name from the specified type.
65 ILogger ILoggerFactory
.Create(Type type
)
71 /// Creates a new logger.
73 ILogger ILoggerFactory
.Create(string name
)
79 /// Creates a new logger, getting the logger name from the specified type.
81 ILogger ILoggerFactory
.Create(Type type
, LoggerLevel level
)
83 return Create(type
, level
);
87 /// Creates a new logger.
89 ILogger ILoggerFactory
.Create(string name
, LoggerLevel level
)
91 return Create(name
, level
);
98 /// Gets the configuration file.
100 /// <param name="filename">i.e. log4net.config</param>
101 /// <returns></returns>
102 protected FileInfo
GetConfigFile(string filename
)
106 if (Path
.IsPathRooted(filename
))
108 result
= new FileInfo(filename
);
112 result
= new FileInfo(Path
.Combine(AppDomain
.CurrentDomain
.BaseDirectory
, filename
));