1 // Copyright 2004-2007 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
20 public abstract class AbstractExtendedLoggerFactory
: MarshalByRefObject
, IExtendedLoggerFactory
22 #region IExtendedLoggerFactory Members
25 /// Creates a new extended logger, getting the logger name from the specified type.
27 public virtual IExtendedLogger
Create(Type type
)
29 if (type
== null) throw new ArgumentNullException("type");
31 return Create(type
.FullName
);
35 /// Creates a new extended logger.
37 public abstract IExtendedLogger
Create(string name
);
40 /// Creates a new extended logger, getting the logger name from the specified type.
42 public virtual IExtendedLogger
Create(Type type
, LoggerLevel level
)
44 if (type
== null) throw new ArgumentNullException("type");
46 return Create(type
.FullName
, level
);
50 /// Creates a new extended logger.
52 public abstract IExtendedLogger
Create(string name
, LoggerLevel level
);
56 #region ILoggerFactory Members
59 /// Creates a new logger, getting the logger name from the specified type.
61 ILogger ILoggerFactory
.Create(Type type
)
67 /// Creates a new logger.
69 ILogger ILoggerFactory
.Create(string name
)
75 /// Creates a new logger, getting the logger name from the specified type.
77 ILogger ILoggerFactory
.Create(Type type
, LoggerLevel level
)
79 return Create(type
, level
);
83 /// Creates a new logger.
85 ILogger ILoggerFactory
.Create(string name
, LoggerLevel level
)
87 return Create(name
, level
);
93 /// Gets the configuration file.
95 /// <param name="filename">i.e. log4net.config</param>
96 /// <returns></returns>
97 protected FileInfo
GetConfigFile(string filename
)
101 if (Path
.IsPathRooted(filename
))
103 result
= new FileInfo(filename
);
107 result
= new FileInfo(Path
.Combine(AppDomain
.CurrentDomain
.BaseDirectory
, filename
));