Permalink
Browse files

a few more follow up changes in 1.11

  • Loading branch information...
1 parent c2ee1d5 commit 98a12b70ffd20dcaf4ccd23221941dbd9a52a12d @kohsuke committed Oct 27, 2011
Showing with 8 additions and 3 deletions.
  1. +8 −3 ServiceDescriptor.cs
View
@@ -233,7 +233,7 @@ public LogHandler LogHandler
{
get
{
- string mode;
+ string mode=null;
// first, backward compatibility with older configuration
XmlElement e = (XmlElement)dom.SelectSingleNode("//logmode");
@@ -242,9 +242,12 @@ public LogHandler LogHandler
} else {
// this is more modern way, to support nested elements as configuration
e = (XmlElement)dom.SelectSingleNode("//log");
- mode = e.GetAttribute("mode");
+ if (e!=null)
+ mode = e.GetAttribute("mode");
}
+ if (mode == null) mode = "append";
+
switch (mode)
{
case "rotate":
@@ -272,8 +275,10 @@ public LogHandler LogHandler
return new SizeBasedRollingLogAppender(LogDirectory, BaseName, sizeThreshold, keepFiles);
case "append":
- default:
return new DefaultLogAppender(LogDirectory, BaseName);
+
+ default:
+ throw new InvalidDataException("Undefined logging mode: " + mode);
}
}

0 comments on commit 98a12b7

Please sign in to comment.