Skip to content
Open
Changes from 1 commit
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
22 changes: 21 additions & 1 deletion src/XmlFileErrorLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,36 @@ namespace Elmah
public class XmlFileErrorLog : ErrorLog
{
private readonly string _logPath;
private const int MaxAppNameLength = 50;

/// <summary>
/// Initializes a new instance of the <see cref="XmlFileErrorLog"/> class
/// using a dictionary of configured settings.
/// </summary>

public XmlFileErrorLog(IDictionary config)
{
string logPath = Mask.NullString(config["logPath"] as string);

//
// Set the application name as this implementation provides
// per-application isolation over shared location.
//

string appName = string.Empty;
if (config.Contains("applicationName"))
{
appName = config["applicationName"].ToString();
}

if (appName.Length > MaxAppNameLength)
{
throw new ApplicationException(string.Format(
"Application name is too long. Maximum length allowed is {0} characters.",
MaxAppNameLength));
}
ApplicationName = appName;

if (logPath.Length == 0)
{
//
Expand Down