You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by bo...@apache.org on 2011/08/17 07:57:04 UTC
svn commit: r1158529 [2/7] - in /logging/log4net/trunk: ./ doc/css/
examples/ examples/mono/ examples/mono/1.0/ examples/mono/1.0/Performance/
examples/mono/1.0/Performance/NotLogging/
examples/mono/1.0/Performance/NotLogging/cs/ examples/mono/1.0/Perf...
Modified: logging/log4net/trunk/examples/net/2.0/Appenders/WmiAppender/cs/src/WmiLayout.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/examples/net/2.0/Appenders/WmiAppender/cs/src/WmiLayout.cs?rev=1158529&r1=1158528&r2=1158529&view=diff
==============================================================================
--- logging/log4net/trunk/examples/net/2.0/Appenders/WmiAppender/cs/src/WmiLayout.cs (original)
+++ logging/log4net/trunk/examples/net/2.0/Appenders/WmiAppender/cs/src/WmiLayout.cs Wed Aug 17 05:57:00 2011
@@ -1,100 +1,100 @@
-#region Apache License
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to you under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#endregion
-
-using System;
-using log4net.Core;
-using System.Management.Instrumentation;
-
-namespace log4net.Appender
-{
- public class WmiLayout
- {
- /// <summary>
- /// Formats a <see cref="LoggingEvent"/> for instrumentation
- /// </summary>
- /// <param name="loggingEvent">the <see cref="LoggingEvent"/> containing the data</param>
- /// <returns>an instrumentation event that can be fired</returns>
- /// <remarks>
- /// <para>
- /// If the <see cref="LoggingEvent.MessageObject"/> of the
- /// <paramref name="loggingEvent" /> is an <see cref="IEvent"/> then
- /// that instance is returned. If the instance also implements the
- /// <see cref="IWmiBoundEvent"/> interface then the <see cref="IWmiBoundEvent.Bind"/>
- /// method will be called on the instance with the <paramref name="loggingEvent" />
- /// parameter.
- /// </para>
- /// <para>
- /// If the <see cref="LoggingEvent.MessageObject"/> of the
- /// <paramref name="loggingEvent" /> is not an <see cref="IEvent"/>
- /// then the <see cref="CreateEvent"/> method will be called
- /// to create an appropriate instrumentation event object.
- /// </para>
- /// </remarks>
- public virtual IEvent Format(LoggingEvent loggingEvent)
- {
- // See if the caller gave us an Instrumentation Event
- IEvent instrumentationEvent = loggingEvent.MessageObject as IEvent;
- if (instrumentationEvent != null)
- {
- // See if the caller gave us a Bound Instrumentation Event
- IWmiBoundEvent boundEvent = instrumentationEvent as IWmiBoundEvent;
- if (boundEvent != null)
- {
- // Attach the logging event to the bound instrumentation event
- boundEvent.Bind(loggingEvent);
- }
-
- return instrumentationEvent;
- }
-
- // We must create our own IEvent
- return CreateEvent(loggingEvent);
- }
-
- /// <summary>
- /// Create the <see cref="IEvent"/> instance that should be fired
- /// </summary>
- /// <param name="loggingEvent">the <see cref="LoggingEvent"/> containing the data</param>
- /// <returns>an instrumentation event that can be fired</returns>
- /// <remarks>
- /// <para>
- /// The default implementation of this method creates a <see cref="WmiLoggingEvent"/>
- /// instance using the data from the <paramref name="loggingEvent" />.
- /// </para>
- /// <para>
- /// Subclasses should override this method to return their own custom
- /// instrumentation event object.
- /// </para>
- /// </remarks>
- protected virtual IEvent CreateEvent(LoggingEvent loggingEvent)
- {
- WmiLoggingEvent wmiEvent = new WmiLoggingEvent();
-
- wmiEvent.TimeStamp = loggingEvent.TimeStamp;
- wmiEvent.LoggerName = loggingEvent.LoggerName;
- wmiEvent.Level = loggingEvent.Level.DisplayName;
- wmiEvent.Message = loggingEvent.RenderedMessage;
- wmiEvent.ThreadName = loggingEvent.ThreadName;
- wmiEvent.ExceptionString = loggingEvent.GetExceptionString();
- wmiEvent.Domain = loggingEvent.Domain;
-
- return wmiEvent;
- }
- }
-}
+#region Apache License
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to you under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#endregion
+
+using System;
+using log4net.Core;
+using System.Management.Instrumentation;
+
+namespace log4net.Appender
+{
+ public class WmiLayout
+ {
+ /// <summary>
+ /// Formats a <see cref="LoggingEvent"/> for instrumentation
+ /// </summary>
+ /// <param name="loggingEvent">the <see cref="LoggingEvent"/> containing the data</param>
+ /// <returns>an instrumentation event that can be fired</returns>
+ /// <remarks>
+ /// <para>
+ /// If the <see cref="LoggingEvent.MessageObject"/> of the
+ /// <paramref name="loggingEvent" /> is an <see cref="IEvent"/> then
+ /// that instance is returned. If the instance also implements the
+ /// <see cref="IWmiBoundEvent"/> interface then the <see cref="IWmiBoundEvent.Bind"/>
+ /// method will be called on the instance with the <paramref name="loggingEvent" />
+ /// parameter.
+ /// </para>
+ /// <para>
+ /// If the <see cref="LoggingEvent.MessageObject"/> of the
+ /// <paramref name="loggingEvent" /> is not an <see cref="IEvent"/>
+ /// then the <see cref="CreateEvent"/> method will be called
+ /// to create an appropriate instrumentation event object.
+ /// </para>
+ /// </remarks>
+ public virtual IEvent Format(LoggingEvent loggingEvent)
+ {
+ // See if the caller gave us an Instrumentation Event
+ IEvent instrumentationEvent = loggingEvent.MessageObject as IEvent;
+ if (instrumentationEvent != null)
+ {
+ // See if the caller gave us a Bound Instrumentation Event
+ IWmiBoundEvent boundEvent = instrumentationEvent as IWmiBoundEvent;
+ if (boundEvent != null)
+ {
+ // Attach the logging event to the bound instrumentation event
+ boundEvent.Bind(loggingEvent);
+ }
+
+ return instrumentationEvent;
+ }
+
+ // We must create our own IEvent
+ return CreateEvent(loggingEvent);
+ }
+
+ /// <summary>
+ /// Create the <see cref="IEvent"/> instance that should be fired
+ /// </summary>
+ /// <param name="loggingEvent">the <see cref="LoggingEvent"/> containing the data</param>
+ /// <returns>an instrumentation event that can be fired</returns>
+ /// <remarks>
+ /// <para>
+ /// The default implementation of this method creates a <see cref="WmiLoggingEvent"/>
+ /// instance using the data from the <paramref name="loggingEvent" />.
+ /// </para>
+ /// <para>
+ /// Subclasses should override this method to return their own custom
+ /// instrumentation event object.
+ /// </para>
+ /// </remarks>
+ protected virtual IEvent CreateEvent(LoggingEvent loggingEvent)
+ {
+ WmiLoggingEvent wmiEvent = new WmiLoggingEvent();
+
+ wmiEvent.TimeStamp = loggingEvent.TimeStamp;
+ wmiEvent.LoggerName = loggingEvent.LoggerName;
+ wmiEvent.Level = loggingEvent.Level.DisplayName;
+ wmiEvent.Message = loggingEvent.RenderedMessage;
+ wmiEvent.ThreadName = loggingEvent.ThreadName;
+ wmiEvent.ExceptionString = loggingEvent.GetExceptionString();
+ wmiEvent.Domain = loggingEvent.Domain;
+
+ return wmiEvent;
+ }
+ }
+}
Propchange: logging/log4net/trunk/examples/net/2.0/Appenders/WmiAppender/cs/src/WmiLayout.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: logging/log4net/trunk/examples/net/2.0/Appenders/WmiAppender/cs/src/WmiLoggingEvent.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/examples/net/2.0/Appenders/WmiAppender/cs/src/WmiLoggingEvent.cs?rev=1158529&r1=1158528&r2=1158529&view=diff
==============================================================================
--- logging/log4net/trunk/examples/net/2.0/Appenders/WmiAppender/cs/src/WmiLoggingEvent.cs (original)
+++ logging/log4net/trunk/examples/net/2.0/Appenders/WmiAppender/cs/src/WmiLoggingEvent.cs Wed Aug 17 05:57:00 2011
@@ -1,47 +1,47 @@
-#region Apache License
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to you under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#endregion
-
-using System;
-using log4net.Core;
-using System.Management.Instrumentation;
-
-namespace log4net.Appender
-{
- /// <summary>
- /// The default instrumented event raised by the <see cref="WmiAppender"/>
- /// </summary>
- /// <remarks>
- /// <para>
- /// This is the default event fired by the <see cref="WmiAppender"/>.
- /// To fire a custom event set the <see cref="WmiAppender.Layout"/> to a
- /// subclass of <see cref="WmiLayout"/> that overrides the <see cref="WmiLayout.CreateEvent"/>
- /// method.
- /// </para>
- /// </remarks>
- public class WmiLoggingEvent : BaseEvent
- {
- public DateTime TimeStamp;
- public string LoggerName;
- public string Level;
- public string Message;
- public string ThreadName;
- public string ExceptionString;
- public string Domain;
- }
-}
+#region Apache License
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to you under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#endregion
+
+using System;
+using log4net.Core;
+using System.Management.Instrumentation;
+
+namespace log4net.Appender
+{
+ /// <summary>
+ /// The default instrumented event raised by the <see cref="WmiAppender"/>
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// This is the default event fired by the <see cref="WmiAppender"/>.
+ /// To fire a custom event set the <see cref="WmiAppender.Layout"/> to a
+ /// subclass of <see cref="WmiLayout"/> that overrides the <see cref="WmiLayout.CreateEvent"/>
+ /// method.
+ /// </para>
+ /// </remarks>
+ public class WmiLoggingEvent : BaseEvent
+ {
+ public DateTime TimeStamp;
+ public string LoggerName;
+ public string Level;
+ public string Message;
+ public string ThreadName;
+ public string ExceptionString;
+ public string Domain;
+ }
+}
Propchange: logging/log4net/trunk/examples/net/2.0/Appenders/WmiAppender/cs/src/WmiLoggingEvent.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: logging/log4net/trunk/examples/net/2.0/Appenders/WmiAppender/nant.config
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/examples/net/2.0/Appenders/WmiAppender/nant.config?rev=1158529&r1=1158528&r2=1158529&view=diff
==============================================================================
--- logging/log4net/trunk/examples/net/2.0/Appenders/WmiAppender/nant.config (original)
+++ logging/log4net/trunk/examples/net/2.0/Appenders/WmiAppender/nant.config Wed Aug 17 05:57:00 2011
@@ -1,21 +1,21 @@
-<?xml version="1.0" ?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements. See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to you under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License. You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
--->
-<project name="configuration" xmlnds="http://tempuri.org/nant-vs.xsd">
- <!-- Include parent configuration file -->
- <include buildfile="../nant.config" />
-</project>
+<?xml version="1.0" ?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to you under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+-->
+<project name="configuration" xmlnds="http://tempuri.org/nant-vs.xsd">
+ <!-- Include parent configuration file -->
+ <include buildfile="../nant.config" />
+</project>
Propchange: logging/log4net/trunk/examples/net/2.0/Appenders/WmiAppender/nant.config
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: logging/log4net/trunk/examples/net/2.0/Appenders/nant.build
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/net/2.0/Appenders/nant.config
('svn:executable' removed)
Modified: logging/log4net/trunk/examples/net/2.0/Layouts/SampleLayoutsApp/cs/src/Layout/LevelConversionPattern.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/examples/net/2.0/Layouts/SampleLayoutsApp/cs/src/Layout/LevelConversionPattern.cs?rev=1158529&r1=1158528&r2=1158529&view=diff
==============================================================================
--- logging/log4net/trunk/examples/net/2.0/Layouts/SampleLayoutsApp/cs/src/Layout/LevelConversionPattern.cs (original)
+++ logging/log4net/trunk/examples/net/2.0/Layouts/SampleLayoutsApp/cs/src/Layout/LevelConversionPattern.cs Wed Aug 17 05:57:00 2011
@@ -1,41 +1,41 @@
-#region Apache License
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to you under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#endregion
-
-using log4net.Core;
-
-namespace SampleLayoutsApp.Layout
-{
- public class LevelConversionPattern
- {
- private Level level;
- private string conversionPattern;
-
- public Level Level
- {
- get { return level; }
- set { level = value; }
- }
-
- public string ConversionPattern
- {
- get { return conversionPattern; }
- set { conversionPattern = value; }
- }
- }
+#region Apache License
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to you under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#endregion
+
+using log4net.Core;
+
+namespace SampleLayoutsApp.Layout
+{
+ public class LevelConversionPattern
+ {
+ private Level level;
+ private string conversionPattern;
+
+ public Level Level
+ {
+ get { return level; }
+ set { level = value; }
+ }
+
+ public string ConversionPattern
+ {
+ get { return conversionPattern; }
+ set { conversionPattern = value; }
+ }
+ }
}
\ No newline at end of file
Propchange: logging/log4net/trunk/examples/net/2.0/Layouts/SampleLayoutsApp/cs/src/Layout/LevelConversionPattern.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: logging/log4net/trunk/examples/net/2.0/Layouts/SampleLayoutsApp/cs/src/Layout/LevelPatternLayout.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/examples/net/2.0/Layouts/SampleLayoutsApp/cs/src/Layout/LevelPatternLayout.cs?rev=1158529&r1=1158528&r2=1158529&view=diff
==============================================================================
--- logging/log4net/trunk/examples/net/2.0/Layouts/SampleLayoutsApp/cs/src/Layout/LevelPatternLayout.cs (original)
+++ logging/log4net/trunk/examples/net/2.0/Layouts/SampleLayoutsApp/cs/src/Layout/LevelPatternLayout.cs Wed Aug 17 05:57:00 2011
@@ -1,50 +1,50 @@
-#region Apache License
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to you under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#endregion
-
-using System.Collections;
-using System.IO;
-using log4net.Core;
-using log4net.Layout;
-
-namespace SampleLayoutsApp.Layout
-{
- public class LevelPatternLayout : PatternLayout
- {
- private readonly Hashtable m_levelToPatternLayout = new Hashtable();
-
- public override void Format(TextWriter writer, LoggingEvent loggingEvent)
- {
- PatternLayout patternLayout = m_levelToPatternLayout[loggingEvent.Level] as PatternLayout;
-
- if (patternLayout == null)
- {
- base.Format(writer, loggingEvent);
- }
- else
- {
- patternLayout.Format(writer, loggingEvent);
- }
- }
-
- public void AddLevelConversionPattern(LevelConversionPattern levelLayout)
- {
- m_levelToPatternLayout[levelLayout.Level] = new PatternLayout(levelLayout.ConversionPattern);
- }
- }
-}
+#region Apache License
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to you under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#endregion
+
+using System.Collections;
+using System.IO;
+using log4net.Core;
+using log4net.Layout;
+
+namespace SampleLayoutsApp.Layout
+{
+ public class LevelPatternLayout : PatternLayout
+ {
+ private readonly Hashtable m_levelToPatternLayout = new Hashtable();
+
+ public override void Format(TextWriter writer, LoggingEvent loggingEvent)
+ {
+ PatternLayout patternLayout = m_levelToPatternLayout[loggingEvent.Level] as PatternLayout;
+
+ if (patternLayout == null)
+ {
+ base.Format(writer, loggingEvent);
+ }
+ else
+ {
+ patternLayout.Format(writer, loggingEvent);
+ }
+ }
+
+ public void AddLevelConversionPattern(LevelConversionPattern levelLayout)
+ {
+ m_levelToPatternLayout[levelLayout.Level] = new PatternLayout(levelLayout.ConversionPattern);
+ }
+ }
+}
Propchange: logging/log4net/trunk/examples/net/2.0/Layouts/SampleLayoutsApp/cs/src/Layout/LevelPatternLayout.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: logging/log4net/trunk/examples/net/2.0/Performance/NotLogging/vb/src/AssemblyInfo.vb
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/net/2.0/Performance/NotLogging/vb/src/NotLogging.vb
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/net/2.0/Repository/SharedModule/vb/src/AssemblyInfo.vb
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/net/2.0/Repository/SharedModule/vb/src/Math.vb
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/net/2.0/Repository/SimpleApp/vb/src/AssemblyInfo.vb
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/net/2.0/Repository/SimpleApp/vb/src/EntryPoint.vb
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/net/2.0/Repository/SimpleModule/vb/src/AssemblyInfo.vb
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/net/2.0/Repository/SimpleModule/vb/src/Math.vb
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/net/2.0/Tutorials/ConsoleApp/vb/src/AssemblyInfo.vb
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/net/2.0/Tutorials/ConsoleApp/vb/src/LoggingExample.vb
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/net/2.0/Tutorials/WebApp/cs/src/Global.asax
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/net/2.0/Tutorials/WebApp/cs/src/WebForm1.aspx
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/net/2.0/Tutorials/WebApp/vb/src/AssemblyInfo.vb
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/net/2.0/Tutorials/WebApp/vb/src/AssemblyVersionInfo.vb
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/net/2.0/Tutorials/WebApp/vb/src/Global.asax
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/net/2.0/Tutorials/WebApp/vb/src/Global.asax.vb
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/net/2.0/Tutorials/WebApp/vb/src/WebForm1.aspx
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/net/2.0/Tutorials/WebApp/vb/src/WebForm1.aspx.vb
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/net/2.0/cs-examples.sln
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/net/2.0/vb-examples.sln
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/netcf/1.0/Tutorials/ConsoleApp/vb/src/AssemblyInfo.vb
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/netcf/1.0/Tutorials/ConsoleApp/vb/src/EntryPoint.vb
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/netcf/1.0/Tutorials/ConsoleApp/vb/src/LoggingExample.vb
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/netcf/1.0/cs-examples.sln
('svn:executable' removed)
Propchange: logging/log4net/trunk/examples/netcf/1.0/vb-examples.sln
('svn:executable' removed)
Propchange: logging/log4net/trunk/extensions/net/1.0/cs-extensions.sln
('svn:executable' removed)
Propchange: logging/log4net/trunk/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: logging/log4net/trunk/src/AssemblyVersionInfo.vb
('svn:executable' removed)
Modified: logging/log4net/trunk/src/Core/ExceptionEvaluator.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/src/Core/ExceptionEvaluator.cs?rev=1158529&r1=1158528&r2=1158529&view=diff
==============================================================================
--- logging/log4net/trunk/src/Core/ExceptionEvaluator.cs (original)
+++ logging/log4net/trunk/src/Core/ExceptionEvaluator.cs Wed Aug 17 05:57:00 2011
@@ -1,130 +1,130 @@
-#region Apache License
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to you under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#endregion
-
-using System;
-
-namespace log4net.Core
-{
- /// <summary>
- /// An evaluator that triggers on an Exception type
- /// </summary>
- /// <remarks>
- /// <para>
- /// This evaluator will trigger if the type of the Exception
- /// passed to <see cref="IsTriggeringEvent(LoggingEvent)"/>
- /// is equal to a Type in <see cref="ExceptionType"/>. ///
- /// </para>
- /// </remarks>
- /// <author>Drew Schaeffer</author>
- public class ExceptionEvaluator : ITriggeringEventEvaluator
- {
- /// <summary>
- /// The type that causes the trigger to fire.
- /// </summary>
- private Type m_type;
-
- /// <summary>
- /// Causes subclasses of <see cref="ExceptionType"/> to cause the trigger to fire.
- /// </summary>
- private bool m_triggerOnSubclass;
-
- /// <summary>
- /// Default ctor to allow dynamic creation through a configurator.
- /// </summary>
- public ExceptionEvaluator()
- {
- // empty
- }
-
- /// <summary>
- /// Constructs an evaluator and initializes to trigger on <paramref name="exType"/>
- /// </summary>
- /// <param name="exType">the type that triggers this evaluator.</param>
- /// <param name="triggerOnSubClass">If true, this evaluator will trigger on subclasses of <see cref="ExceptionType"/>.</param>
- public ExceptionEvaluator(Type exType, bool triggerOnSubClass)
- {
- if (exType == null)
- {
- throw new ArgumentNullException("exType");
- }
-
- m_type = exType;
- m_triggerOnSubclass = triggerOnSubClass;
- }
-
- /// <summary>
- /// The type that triggers this evaluator.
- /// </summary>
- public Type ExceptionType
- {
- get { return m_type; }
- set { m_type = value; }
- }
-
- /// <summary>
- /// If true, this evaluator will trigger on subclasses of <see cref="ExceptionType"/>.
- /// </summary>
- public bool TriggerOnSubclass
- {
- get { return m_triggerOnSubclass; }
- set { m_triggerOnSubclass = value; }
- }
-
- #region ITriggeringEventEvaluator Members
-
- /// <summary>
- /// Is this <paramref name="loggingEvent"/> the triggering event?
- /// </summary>
- /// <param name="loggingEvent">The event to check</param>
- /// <returns>This method returns <c>true</c>, if the logging event Exception
- /// Type is <see cref="ExceptionType"/>.
- /// Otherwise it returns <c>false</c></returns>
- /// <remarks>
- /// <para>
- /// This evaluator will trigger if the Exception Type of the event
- /// passed to <see cref="IsTriggeringEvent(LoggingEvent)"/>
- /// is <see cref="ExceptionType"/>.
- /// </para>
- /// </remarks>
- public bool IsTriggeringEvent(LoggingEvent loggingEvent)
- {
- if (loggingEvent == null)
- {
- throw new ArgumentNullException("loggingEvent");
- }
-
- if (m_triggerOnSubclass && loggingEvent.ExceptionObject != null)
- {
- // check if loggingEvent.ExceptionObject is of type ExceptionType or subclass of ExceptionType
- Type exceptionObjectType = loggingEvent.ExceptionObject.GetType();
- return exceptionObjectType == m_type || exceptionObjectType.IsSubclassOf(m_type);
- }
- else if (!m_triggerOnSubclass && loggingEvent.ExceptionObject != null)
- { // check if loggingEvent.ExceptionObject is of type ExceptionType
- return loggingEvent.ExceptionObject.GetType() == m_type;
- }
- else
- { // loggingEvent.ExceptionObject is null
- return false;
- }
- }
-
- #endregion
- }
-}
+#region Apache License
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to you under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#endregion
+
+using System;
+
+namespace log4net.Core
+{
+ /// <summary>
+ /// An evaluator that triggers on an Exception type
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// This evaluator will trigger if the type of the Exception
+ /// passed to <see cref="IsTriggeringEvent(LoggingEvent)"/>
+ /// is equal to a Type in <see cref="ExceptionType"/>. ///
+ /// </para>
+ /// </remarks>
+ /// <author>Drew Schaeffer</author>
+ public class ExceptionEvaluator : ITriggeringEventEvaluator
+ {
+ /// <summary>
+ /// The type that causes the trigger to fire.
+ /// </summary>
+ private Type m_type;
+
+ /// <summary>
+ /// Causes subclasses of <see cref="ExceptionType"/> to cause the trigger to fire.
+ /// </summary>
+ private bool m_triggerOnSubclass;
+
+ /// <summary>
+ /// Default ctor to allow dynamic creation through a configurator.
+ /// </summary>
+ public ExceptionEvaluator()
+ {
+ // empty
+ }
+
+ /// <summary>
+ /// Constructs an evaluator and initializes to trigger on <paramref name="exType"/>
+ /// </summary>
+ /// <param name="exType">the type that triggers this evaluator.</param>
+ /// <param name="triggerOnSubClass">If true, this evaluator will trigger on subclasses of <see cref="ExceptionType"/>.</param>
+ public ExceptionEvaluator(Type exType, bool triggerOnSubClass)
+ {
+ if (exType == null)
+ {
+ throw new ArgumentNullException("exType");
+ }
+
+ m_type = exType;
+ m_triggerOnSubclass = triggerOnSubClass;
+ }
+
+ /// <summary>
+ /// The type that triggers this evaluator.
+ /// </summary>
+ public Type ExceptionType
+ {
+ get { return m_type; }
+ set { m_type = value; }
+ }
+
+ /// <summary>
+ /// If true, this evaluator will trigger on subclasses of <see cref="ExceptionType"/>.
+ /// </summary>
+ public bool TriggerOnSubclass
+ {
+ get { return m_triggerOnSubclass; }
+ set { m_triggerOnSubclass = value; }
+ }
+
+ #region ITriggeringEventEvaluator Members
+
+ /// <summary>
+ /// Is this <paramref name="loggingEvent"/> the triggering event?
+ /// </summary>
+ /// <param name="loggingEvent">The event to check</param>
+ /// <returns>This method returns <c>true</c>, if the logging event Exception
+ /// Type is <see cref="ExceptionType"/>.
+ /// Otherwise it returns <c>false</c></returns>
+ /// <remarks>
+ /// <para>
+ /// This evaluator will trigger if the Exception Type of the event
+ /// passed to <see cref="IsTriggeringEvent(LoggingEvent)"/>
+ /// is <see cref="ExceptionType"/>.
+ /// </para>
+ /// </remarks>
+ public bool IsTriggeringEvent(LoggingEvent loggingEvent)
+ {
+ if (loggingEvent == null)
+ {
+ throw new ArgumentNullException("loggingEvent");
+ }
+
+ if (m_triggerOnSubclass && loggingEvent.ExceptionObject != null)
+ {
+ // check if loggingEvent.ExceptionObject is of type ExceptionType or subclass of ExceptionType
+ Type exceptionObjectType = loggingEvent.ExceptionObject.GetType();
+ return exceptionObjectType == m_type || exceptionObjectType.IsSubclassOf(m_type);
+ }
+ else if (!m_triggerOnSubclass && loggingEvent.ExceptionObject != null)
+ { // check if loggingEvent.ExceptionObject is of type ExceptionType
+ return loggingEvent.ExceptionObject.GetType() == m_type;
+ }
+ else
+ { // loggingEvent.ExceptionObject is null
+ return false;
+ }
+ }
+
+ #endregion
+ }
+}
Propchange: logging/log4net/trunk/src/Core/ExceptionEvaluator.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: logging/log4net/trunk/src/Core/TimeEvaluator.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/src/Core/TimeEvaluator.cs?rev=1158529&r1=1158528&r2=1158529&view=diff
==============================================================================
--- logging/log4net/trunk/src/Core/TimeEvaluator.cs (original)
+++ logging/log4net/trunk/src/Core/TimeEvaluator.cs Wed Aug 17 05:57:00 2011
@@ -1,147 +1,147 @@
-#region Copyright & License
-//
-// Copyright 2001-2005 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#endregion
-
-using System;
-
-namespace log4net.Core
-{
- /// <summary>
- /// An evaluator that triggers after specified number of seconds.
- /// </summary>
- /// <remarks>
- /// <para>
- /// This evaluator will trigger if the specified time period
- /// <see cref="Interval"/> has passed since last check.
- /// </para>
- /// </remarks>
- /// <author>Robert Sevcik</author>
- public class TimeEvaluator : ITriggeringEventEvaluator
- {
- /// <summary>
- /// The time threshold for triggering in seconds. Zero means it won't trigger at all.
- /// </summary>
- private int m_interval;
-
- /// <summary>
- /// The time of last check. This gets updated when the object is created and when the evaluator triggers.
- /// </summary>
- private DateTime m_lasttime;
-
- /// <summary>
- /// The default time threshold for triggering in seconds. Zero means it won't trigger at all.
- /// </summary>
- const int DEFAULT_INTERVAL = 0;
-
- /// <summary>
- /// Create a new evaluator using the <see cref="DEFAULT_INTERVAL"/> time threshold in seconds.
- /// </summary>
- /// <remarks>
- /// <para>
- /// Create a new evaluator using the <see cref="DEFAULT_INTERVAL"/> time threshold in seconds.
- /// </para>
- /// <para>
- /// This evaluator will trigger if the specified time period
- /// <see cref="Interval"/> has passed since last check.
- /// </para>
- /// </remarks>
- public TimeEvaluator()
- : this(DEFAULT_INTERVAL)
- {
- }
-
- /// <summary>
- /// Create a new evaluator using the specified time threshold in seconds.
- /// </summary>
- /// <param name="interval">
- /// The time threshold in seconds to trigger after.
- /// Zero means it won't trigger at all.
- /// </param>
- /// <remarks>
- /// <para>
- /// Create a new evaluator using the specified time threshold in seconds.
- /// </para>
- /// <para>
- /// This evaluator will trigger if the specified time period
- /// <see cref="Interval"/> has passed since last check.
- /// </para>
- /// </remarks>
- public TimeEvaluator(int interval)
- {
- m_interval = interval;
- m_lasttime = DateTime.Now;
- }
-
- /// <summary>
- /// The time threshold in seconds to trigger after
- /// </summary>
- /// <value>
- /// The time threshold in seconds to trigger after.
- /// Zero means it won't trigger at all.
- /// </value>
- /// <remarks>
- /// <para>
- /// This evaluator will trigger if the specified time period
- /// <see cref="Interval"/> has passed since last check.
- /// </para>
- /// </remarks>
- public int Interval
- {
- get { return m_interval; }
- set { m_interval = value; }
- }
-
- /// <summary>
- /// Is this <paramref name="loggingEvent"/> the triggering event?
- /// </summary>
- /// <param name="loggingEvent">The event to check</param>
- /// <returns>This method returns <c>true</c>, if the specified time period
- /// <see cref="Interval"/> has passed since last check..
- /// Otherwise it returns <c>false</c></returns>
- /// <remarks>
- /// <para>
- /// This evaluator will trigger if the specified time period
- /// <see cref="Interval"/> has passed since last check.
- /// </para>
- /// </remarks>
- public bool IsTriggeringEvent(LoggingEvent loggingEvent)
- {
- if (loggingEvent == null)
- {
- throw new ArgumentNullException("loggingEvent");
- }
-
- // disable the evaluator if threshold is zero
- if (m_interval == 0) return false;
-
- lock (this) // avoid triggering multiple times
- {
- TimeSpan passed = DateTime.Now.Subtract(m_lasttime);
-
- if (passed.TotalSeconds > m_interval)
- {
- m_lasttime = DateTime.Now;
- return true;
- }
- else
- {
- return false;
- }
- }
- }
- }
-}
+#region Copyright & License
+//
+// Copyright 2001-2005 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#endregion
+
+using System;
+
+namespace log4net.Core
+{
+ /// <summary>
+ /// An evaluator that triggers after specified number of seconds.
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// This evaluator will trigger if the specified time period
+ /// <see cref="Interval"/> has passed since last check.
+ /// </para>
+ /// </remarks>
+ /// <author>Robert Sevcik</author>
+ public class TimeEvaluator : ITriggeringEventEvaluator
+ {
+ /// <summary>
+ /// The time threshold for triggering in seconds. Zero means it won't trigger at all.
+ /// </summary>
+ private int m_interval;
+
+ /// <summary>
+ /// The time of last check. This gets updated when the object is created and when the evaluator triggers.
+ /// </summary>
+ private DateTime m_lasttime;
+
+ /// <summary>
+ /// The default time threshold for triggering in seconds. Zero means it won't trigger at all.
+ /// </summary>
+ const int DEFAULT_INTERVAL = 0;
+
+ /// <summary>
+ /// Create a new evaluator using the <see cref="DEFAULT_INTERVAL"/> time threshold in seconds.
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// Create a new evaluator using the <see cref="DEFAULT_INTERVAL"/> time threshold in seconds.
+ /// </para>
+ /// <para>
+ /// This evaluator will trigger if the specified time period
+ /// <see cref="Interval"/> has passed since last check.
+ /// </para>
+ /// </remarks>
+ public TimeEvaluator()
+ : this(DEFAULT_INTERVAL)
+ {
+ }
+
+ /// <summary>
+ /// Create a new evaluator using the specified time threshold in seconds.
+ /// </summary>
+ /// <param name="interval">
+ /// The time threshold in seconds to trigger after.
+ /// Zero means it won't trigger at all.
+ /// </param>
+ /// <remarks>
+ /// <para>
+ /// Create a new evaluator using the specified time threshold in seconds.
+ /// </para>
+ /// <para>
+ /// This evaluator will trigger if the specified time period
+ /// <see cref="Interval"/> has passed since last check.
+ /// </para>
+ /// </remarks>
+ public TimeEvaluator(int interval)
+ {
+ m_interval = interval;
+ m_lasttime = DateTime.Now;
+ }
+
+ /// <summary>
+ /// The time threshold in seconds to trigger after
+ /// </summary>
+ /// <value>
+ /// The time threshold in seconds to trigger after.
+ /// Zero means it won't trigger at all.
+ /// </value>
+ /// <remarks>
+ /// <para>
+ /// This evaluator will trigger if the specified time period
+ /// <see cref="Interval"/> has passed since last check.
+ /// </para>
+ /// </remarks>
+ public int Interval
+ {
+ get { return m_interval; }
+ set { m_interval = value; }
+ }
+
+ /// <summary>
+ /// Is this <paramref name="loggingEvent"/> the triggering event?
+ /// </summary>
+ /// <param name="loggingEvent">The event to check</param>
+ /// <returns>This method returns <c>true</c>, if the specified time period
+ /// <see cref="Interval"/> has passed since last check..
+ /// Otherwise it returns <c>false</c></returns>
+ /// <remarks>
+ /// <para>
+ /// This evaluator will trigger if the specified time period
+ /// <see cref="Interval"/> has passed since last check.
+ /// </para>
+ /// </remarks>
+ public bool IsTriggeringEvent(LoggingEvent loggingEvent)
+ {
+ if (loggingEvent == null)
+ {
+ throw new ArgumentNullException("loggingEvent");
+ }
+
+ // disable the evaluator if threshold is zero
+ if (m_interval == 0) return false;
+
+ lock (this) // avoid triggering multiple times
+ {
+ TimeSpan passed = DateTime.Now.Subtract(m_lasttime);
+
+ if (passed.TotalSeconds > m_interval)
+ {
+ m_lasttime = DateTime.Now;
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+ }
+}
Propchange: logging/log4net/trunk/src/Core/TimeEvaluator.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: logging/log4net/trunk/src/Layout/Pattern/AspNetCachePatternConverter.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/src/Layout/Pattern/AspNetCachePatternConverter.cs?rev=1158529&r1=1158528&r2=1158529&view=diff
==============================================================================
--- logging/log4net/trunk/src/Layout/Pattern/AspNetCachePatternConverter.cs (original)
+++ logging/log4net/trunk/src/Layout/Pattern/AspNetCachePatternConverter.cs Wed Aug 17 05:57:00 2011
@@ -1,77 +1,77 @@
-#region Apache License
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to you under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#endregion
-
-// .NET Compact Framework 1.0 has no support for ASP.NET
-// SSCLI 1.0 has no support for ASP.NET
-#if !NETCF && !SSCLI
-
-using System.IO;
-using System.Web;
-using log4net.Core;
-using log4net.Util;
-
-namespace log4net.Layout.Pattern
-{
- /// <summary>
- /// Converter for items in the ASP.Net Cache.
- /// </summary>
- /// <remarks>
- /// <para>
- /// Outputs an item from the <see cref="HttpRuntime.Cache" />.
- /// </para>
- /// </remarks>
- /// <author>Ron Grabowski</author>
- internal sealed class AspNetCachePatternConverter : AspNetPatternLayoutConverter
- {
- /// <summary>
- /// Write the ASP.Net Cache item to the output
- /// </summary>
- /// <param name="writer"><see cref="TextWriter" /> that will receive the formatted result.</param>
- /// <param name="loggingEvent">The <see cref="LoggingEvent" /> on which the pattern converter should be executed.</param>
- /// <param name="httpContext">The <see cref="HttpContext" /> under which the ASP.Net request is running.</param>
- /// <remarks>
- /// <para>
- /// Writes out the value of a named property. The property name
- /// should be set in the <see cref="log4net.Util.PatternConverter.Option"/>
- /// property. If no property has been set, all key value pairs from the Cache will
- /// be written to the output.
- /// </para>
- /// </remarks>
- protected override void Convert(TextWriter writer, LoggingEvent loggingEvent, HttpContext httpContext)
- {
- if (HttpRuntime.Cache != null)
- {
- if (Option != null)
- {
- WriteObject(writer, loggingEvent.Repository, HttpRuntime.Cache[Option]);
- }
- else
- {
- WriteObject(writer, loggingEvent.Repository, HttpRuntime.Cache.GetEnumerator());
- }
- }
- else
- {
- writer.Write(SystemInfo.NotAvailableText);
- }
- }
- }
-}
-
+#region Apache License
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to you under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#endregion
+
+// .NET Compact Framework 1.0 has no support for ASP.NET
+// SSCLI 1.0 has no support for ASP.NET
+#if !NETCF && !SSCLI
+
+using System.IO;
+using System.Web;
+using log4net.Core;
+using log4net.Util;
+
+namespace log4net.Layout.Pattern
+{
+ /// <summary>
+ /// Converter for items in the ASP.Net Cache.
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// Outputs an item from the <see cref="HttpRuntime.Cache" />.
+ /// </para>
+ /// </remarks>
+ /// <author>Ron Grabowski</author>
+ internal sealed class AspNetCachePatternConverter : AspNetPatternLayoutConverter
+ {
+ /// <summary>
+ /// Write the ASP.Net Cache item to the output
+ /// </summary>
+ /// <param name="writer"><see cref="TextWriter" /> that will receive the formatted result.</param>
+ /// <param name="loggingEvent">The <see cref="LoggingEvent" /> on which the pattern converter should be executed.</param>
+ /// <param name="httpContext">The <see cref="HttpContext" /> under which the ASP.Net request is running.</param>
+ /// <remarks>
+ /// <para>
+ /// Writes out the value of a named property. The property name
+ /// should be set in the <see cref="log4net.Util.PatternConverter.Option"/>
+ /// property. If no property has been set, all key value pairs from the Cache will
+ /// be written to the output.
+ /// </para>
+ /// </remarks>
+ protected override void Convert(TextWriter writer, LoggingEvent loggingEvent, HttpContext httpContext)
+ {
+ if (HttpRuntime.Cache != null)
+ {
+ if (Option != null)
+ {
+ WriteObject(writer, loggingEvent.Repository, HttpRuntime.Cache[Option]);
+ }
+ else
+ {
+ WriteObject(writer, loggingEvent.Repository, HttpRuntime.Cache.GetEnumerator());
+ }
+ }
+ else
+ {
+ writer.Write(SystemInfo.NotAvailableText);
+ }
+ }
+ }
+}
+
#endif
\ No newline at end of file
Propchange: logging/log4net/trunk/src/Layout/Pattern/AspNetCachePatternConverter.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: logging/log4net/trunk/src/Layout/Pattern/AspNetContextPatternConverter.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/src/Layout/Pattern/AspNetContextPatternConverter.cs?rev=1158529&r1=1158528&r2=1158529&view=diff
==============================================================================
--- logging/log4net/trunk/src/Layout/Pattern/AspNetContextPatternConverter.cs (original)
+++ logging/log4net/trunk/src/Layout/Pattern/AspNetContextPatternConverter.cs Wed Aug 17 05:57:00 2011
@@ -1,68 +1,68 @@
-#region Apache License
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to you under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#endregion
-
-// .NET Compact Framework 1.0 has no support for ASP.NET
-// SSCLI 1.0 has no support for ASP.NET
-#if !NETCF && !SSCLI
-
-using System.IO;
-using System.Web;
-using log4net.Core;
-
-namespace log4net.Layout.Pattern
-{
- /// <summary>
- /// Converter for items in the <see cref="HttpContext" />.
- /// </summary>
- /// <remarks>
- /// <para>
- /// Outputs an item from the <see cref="HttpContext" />.
- /// </para>
- /// </remarks>
- /// <author>Ron Grabowski</author>
- internal sealed class AspNetContextPatternConverter : AspNetPatternLayoutConverter
- {
- /// <summary>
- /// Write the ASP.Net HttpContext item to the output
- /// </summary>
- /// <param name="writer"><see cref="TextWriter" /> that will receive the formatted result.</param>
- /// <param name="loggingEvent">The <see cref="LoggingEvent" /> on which the pattern converter should be executed.</param>
- /// <param name="httpContext">The <see cref="HttpContext" /> under which the ASP.Net request is running.</param>
- /// <remarks>
- /// <para>
- /// Writes out the value of a named property. The property name
- /// should be set in the <see cref="log4net.Util.PatternConverter.Option"/>
- /// property.
- /// </para>
- /// </remarks>
- protected override void Convert(TextWriter writer, LoggingEvent loggingEvent, HttpContext httpContext)
- {
- if (Option != null)
- {
- WriteObject(writer, loggingEvent.Repository, httpContext.Items[Option]);
- }
- else
- {
- WriteObject(writer, loggingEvent.Repository, httpContext.Items);
- }
- }
- }
-}
-
+#region Apache License
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to you under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#endregion
+
+// .NET Compact Framework 1.0 has no support for ASP.NET
+// SSCLI 1.0 has no support for ASP.NET
+#if !NETCF && !SSCLI
+
+using System.IO;
+using System.Web;
+using log4net.Core;
+
+namespace log4net.Layout.Pattern
+{
+ /// <summary>
+ /// Converter for items in the <see cref="HttpContext" />.
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// Outputs an item from the <see cref="HttpContext" />.
+ /// </para>
+ /// </remarks>
+ /// <author>Ron Grabowski</author>
+ internal sealed class AspNetContextPatternConverter : AspNetPatternLayoutConverter
+ {
+ /// <summary>
+ /// Write the ASP.Net HttpContext item to the output
+ /// </summary>
+ /// <param name="writer"><see cref="TextWriter" /> that will receive the formatted result.</param>
+ /// <param name="loggingEvent">The <see cref="LoggingEvent" /> on which the pattern converter should be executed.</param>
+ /// <param name="httpContext">The <see cref="HttpContext" /> under which the ASP.Net request is running.</param>
+ /// <remarks>
+ /// <para>
+ /// Writes out the value of a named property. The property name
+ /// should be set in the <see cref="log4net.Util.PatternConverter.Option"/>
+ /// property.
+ /// </para>
+ /// </remarks>
+ protected override void Convert(TextWriter writer, LoggingEvent loggingEvent, HttpContext httpContext)
+ {
+ if (Option != null)
+ {
+ WriteObject(writer, loggingEvent.Repository, httpContext.Items[Option]);
+ }
+ else
+ {
+ WriteObject(writer, loggingEvent.Repository, httpContext.Items);
+ }
+ }
+ }
+}
+
#endif
\ No newline at end of file
Propchange: logging/log4net/trunk/src/Layout/Pattern/AspNetContextPatternConverter.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: logging/log4net/trunk/src/Layout/Pattern/AspNetPatternConverter.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/src/Layout/Pattern/AspNetPatternConverter.cs?rev=1158529&r1=1158528&r2=1158529&view=diff
==============================================================================
--- logging/log4net/trunk/src/Layout/Pattern/AspNetPatternConverter.cs (original)
+++ logging/log4net/trunk/src/Layout/Pattern/AspNetPatternConverter.cs Wed Aug 17 05:57:00 2011
@@ -1,65 +1,65 @@
-#region Apache License
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to you under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#endregion
-
-// .NET Compact Framework 1.0 has no support for ASP.NET
-// SSCLI 1.0 has no support for ASP.NET
-#if !NETCF && !SSCLI
-
-using System.IO;
-using System.Web;
-using log4net.Core;
-using log4net.Util;
-
-namespace log4net.Layout.Pattern
-{
- /// <summary>
- /// Abstract class that provides access to the current HttpContext (<see cref="HttpContext.Current" />) that
- /// derived classes need.
- /// </summary>
- /// <remarks>
- /// This class handles the case when HttpContext.Current is null by writing
- /// <see cref="SystemInfo.NotAvailableText" /> to the writer.
- /// </remarks>
- /// <author>Ron Grabowski</author>
- internal abstract class AspNetPatternLayoutConverter : PatternLayoutConverter
- {
- protected override void Convert(TextWriter writer, LoggingEvent loggingEvent)
- {
- if (HttpContext.Current == null)
- {
- writer.Write(SystemInfo.NotAvailableText);
- }
- else
- {
- Convert(writer, loggingEvent, HttpContext.Current);
- }
- }
-
- /// <summary>
- /// Derived pattern converters must override this method in order to
- /// convert conversion specifiers in the correct way.
- /// </summary>
- /// <param name="writer"><see cref="TextWriter" /> that will receive the formatted result.</param>
- /// <param name="loggingEvent">The <see cref="LoggingEvent" /> on which the pattern converter should be executed.</param>
- /// <param name="httpContext">The <see cref="HttpContext" /> under which the ASP.Net request is running.</param>
- protected abstract void Convert(TextWriter writer, LoggingEvent loggingEvent, HttpContext httpContext);
- }
-}
-
+#region Apache License
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to you under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#endregion
+
+// .NET Compact Framework 1.0 has no support for ASP.NET
+// SSCLI 1.0 has no support for ASP.NET
+#if !NETCF && !SSCLI
+
+using System.IO;
+using System.Web;
+using log4net.Core;
+using log4net.Util;
+
+namespace log4net.Layout.Pattern
+{
+ /// <summary>
+ /// Abstract class that provides access to the current HttpContext (<see cref="HttpContext.Current" />) that
+ /// derived classes need.
+ /// </summary>
+ /// <remarks>
+ /// This class handles the case when HttpContext.Current is null by writing
+ /// <see cref="SystemInfo.NotAvailableText" /> to the writer.
+ /// </remarks>
+ /// <author>Ron Grabowski</author>
+ internal abstract class AspNetPatternLayoutConverter : PatternLayoutConverter
+ {
+ protected override void Convert(TextWriter writer, LoggingEvent loggingEvent)
+ {
+ if (HttpContext.Current == null)
+ {
+ writer.Write(SystemInfo.NotAvailableText);
+ }
+ else
+ {
+ Convert(writer, loggingEvent, HttpContext.Current);
+ }
+ }
+
+ /// <summary>
+ /// Derived pattern converters must override this method in order to
+ /// convert conversion specifiers in the correct way.
+ /// </summary>
+ /// <param name="writer"><see cref="TextWriter" /> that will receive the formatted result.</param>
+ /// <param name="loggingEvent">The <see cref="LoggingEvent" /> on which the pattern converter should be executed.</param>
+ /// <param name="httpContext">The <see cref="HttpContext" /> under which the ASP.Net request is running.</param>
+ protected abstract void Convert(TextWriter writer, LoggingEvent loggingEvent, HttpContext httpContext);
+ }
+}
+
#endif
\ No newline at end of file
Propchange: logging/log4net/trunk/src/Layout/Pattern/AspNetPatternConverter.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: logging/log4net/trunk/src/Layout/Pattern/AspNetRequestPatternConverter.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/src/Layout/Pattern/AspNetRequestPatternConverter.cs?rev=1158529&r1=1158528&r2=1158529&view=diff
==============================================================================
--- logging/log4net/trunk/src/Layout/Pattern/AspNetRequestPatternConverter.cs (original)
+++ logging/log4net/trunk/src/Layout/Pattern/AspNetRequestPatternConverter.cs Wed Aug 17 05:57:00 2011
@@ -1,76 +1,76 @@
-#region Apache License
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to you under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#endregion
-
-// .NET Compact Framework 1.0 has no support for ASP.NET
-// SSCLI 1.0 has no support for ASP.NET
-#if !NETCF && !SSCLI
-
-using System.IO;
-using System.Web;
-using log4net.Core;
-using log4net.Util;
-
-namespace log4net.Layout.Pattern
-{
- /// <summary>
- /// Converter for items in the ASP.Net Cache.
- /// </summary>
- /// <remarks>
- /// <para>
- /// Outputs an item from the <see cref="HttpRuntime.Cache" />.
- /// </para>
- /// </remarks>
- /// <author>Ron Grabowski</author>
- internal sealed class AspNetRequestPatternConverter : AspNetPatternLayoutConverter
- {
- /// <summary>
- /// Write the ASP.Net Cache item to the output
- /// </summary>
- /// <param name="writer"><see cref="TextWriter" /> that will receive the formatted result.</param>
- /// <param name="loggingEvent">The <see cref="LoggingEvent" /> on which the pattern converter should be executed.</param>
- /// <param name="httpContext">The <see cref="HttpContext" /> under which the ASP.Net request is running.</param>
- /// <remarks>
- /// <para>
- /// Writes out the value of a named property. The property name
- /// should be set in the <see cref="log4net.Util.PatternConverter.Option"/>
- /// property.
- /// </para>
- /// </remarks>
- protected override void Convert(TextWriter writer, LoggingEvent loggingEvent, HttpContext httpContext)
- {
- if (httpContext.Request != null)
- {
- if (Option != null)
- {
- WriteObject(writer, loggingEvent.Repository, httpContext.Request.Params[Option]);
- }
- else
- {
- WriteObject(writer, loggingEvent.Repository, httpContext.Request.Params);
- }
- }
- else
- {
- writer.Write(SystemInfo.NotAvailableText);
- }
- }
- }
-}
-
+#region Apache License
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to you under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#endregion
+
+// .NET Compact Framework 1.0 has no support for ASP.NET
+// SSCLI 1.0 has no support for ASP.NET
+#if !NETCF && !SSCLI
+
+using System.IO;
+using System.Web;
+using log4net.Core;
+using log4net.Util;
+
+namespace log4net.Layout.Pattern
+{
+ /// <summary>
+ /// Converter for items in the ASP.Net Cache.
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// Outputs an item from the <see cref="HttpRuntime.Cache" />.
+ /// </para>
+ /// </remarks>
+ /// <author>Ron Grabowski</author>
+ internal sealed class AspNetRequestPatternConverter : AspNetPatternLayoutConverter
+ {
+ /// <summary>
+ /// Write the ASP.Net Cache item to the output
+ /// </summary>
+ /// <param name="writer"><see cref="TextWriter" /> that will receive the formatted result.</param>
+ /// <param name="loggingEvent">The <see cref="LoggingEvent" /> on which the pattern converter should be executed.</param>
+ /// <param name="httpContext">The <see cref="HttpContext" /> under which the ASP.Net request is running.</param>
+ /// <remarks>
+ /// <para>
+ /// Writes out the value of a named property. The property name
+ /// should be set in the <see cref="log4net.Util.PatternConverter.Option"/>
+ /// property.
+ /// </para>
+ /// </remarks>
+ protected override void Convert(TextWriter writer, LoggingEvent loggingEvent, HttpContext httpContext)
+ {
+ if (httpContext.Request != null)
+ {
+ if (Option != null)
+ {
+ WriteObject(writer, loggingEvent.Repository, httpContext.Request.Params[Option]);
+ }
+ else
+ {
+ WriteObject(writer, loggingEvent.Repository, httpContext.Request.Params);
+ }
+ }
+ else
+ {
+ writer.Write(SystemInfo.NotAvailableText);
+ }
+ }
+ }
+}
+
#endif
\ No newline at end of file
Propchange: logging/log4net/trunk/src/Layout/Pattern/AspNetRequestPatternConverter.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: logging/log4net/trunk/src/Layout/Pattern/AspNetSessionPatternConverter.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/src/Layout/Pattern/AspNetSessionPatternConverter.cs?rev=1158529&r1=1158528&r2=1158529&view=diff
==============================================================================
--- logging/log4net/trunk/src/Layout/Pattern/AspNetSessionPatternConverter.cs (original)
+++ logging/log4net/trunk/src/Layout/Pattern/AspNetSessionPatternConverter.cs Wed Aug 17 05:57:00 2011
@@ -1,77 +1,77 @@
-#region Apache License
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to you under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#endregion
-
-// .NET Compact Framework 1.0 has no support for ASP.NET
-// SSCLI 1.0 has no support for ASP.NET
-#if !NETCF && !SSCLI
-
-using System.IO;
-using System.Web;
-using log4net.Core;
-using log4net.Util;
-
-namespace log4net.Layout.Pattern
-{
- /// <summary>
- /// Converter for items in the ASP.Net Cache.
- /// </summary>
- /// <remarks>
- /// <para>
- /// Outputs an item from the <see cref="HttpRuntime.Cache" />.
- /// </para>
- /// </remarks>
- /// <author>Ron Grabowski</author>
- internal sealed class AspNetSessionPatternConverter : AspNetPatternLayoutConverter
- {
- /// <summary>
- /// Write the ASP.Net Cache item to the output
- /// </summary>
- /// <param name="writer"><see cref="TextWriter" /> that will receive the formatted result.</param>
- /// <param name="loggingEvent">The <see cref="LoggingEvent" /> on which the pattern converter should be executed.</param>
- /// <param name="httpContext">The <see cref="HttpContext" /> under which the ASP.Net request is running.</param>
- /// <remarks>
- /// <para>
- /// Writes out the value of a named property. The property name
- /// should be set in the <see cref="log4net.Util.PatternConverter.Option"/>
- /// property. If no property has been set, all key value pairs from the Session will
- /// be written to the output.
- /// </para>
- /// </remarks>
- protected override void Convert(TextWriter writer, LoggingEvent loggingEvent, HttpContext httpContext)
- {
- if (httpContext.Session != null)
- {
- if (Option != null)
- {
- WriteObject(writer, loggingEvent.Repository, httpContext.Session.Contents[Option]);
- }
- else
- {
- WriteObject(writer, loggingEvent.Repository, httpContext.Session);
- }
- }
- else
- {
- writer.Write(SystemInfo.NotAvailableText);
- }
- }
- }
-}
-
+#region Apache License
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to you under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#endregion
+
+// .NET Compact Framework 1.0 has no support for ASP.NET
+// SSCLI 1.0 has no support for ASP.NET
+#if !NETCF && !SSCLI
+
+using System.IO;
+using System.Web;
+using log4net.Core;
+using log4net.Util;
+
+namespace log4net.Layout.Pattern
+{
+ /// <summary>
+ /// Converter for items in the ASP.Net Cache.
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// Outputs an item from the <see cref="HttpRuntime.Cache" />.
+ /// </para>
+ /// </remarks>
+ /// <author>Ron Grabowski</author>
+ internal sealed class AspNetSessionPatternConverter : AspNetPatternLayoutConverter
+ {
+ /// <summary>
+ /// Write the ASP.Net Cache item to the output
+ /// </summary>
+ /// <param name="writer"><see cref="TextWriter" /> that will receive the formatted result.</param>
+ /// <param name="loggingEvent">The <see cref="LoggingEvent" /> on which the pattern converter should be executed.</param>
+ /// <param name="httpContext">The <see cref="HttpContext" /> under which the ASP.Net request is running.</param>
+ /// <remarks>
+ /// <para>
+ /// Writes out the value of a named property. The property name
+ /// should be set in the <see cref="log4net.Util.PatternConverter.Option"/>
+ /// property. If no property has been set, all key value pairs from the Session will
+ /// be written to the output.
+ /// </para>
+ /// </remarks>
+ protected override void Convert(TextWriter writer, LoggingEvent loggingEvent, HttpContext httpContext)
+ {
+ if (httpContext.Session != null)
+ {
+ if (Option != null)
+ {
+ WriteObject(writer, loggingEvent.Repository, httpContext.Session.Contents[Option]);
+ }
+ else
+ {
+ WriteObject(writer, loggingEvent.Repository, httpContext.Session);
+ }
+ }
+ else
+ {
+ writer.Write(SystemInfo.NotAvailableText);
+ }
+ }
+ }
+}
+
#endif
\ No newline at end of file
Propchange: logging/log4net/trunk/src/Layout/Pattern/AspNetSessionPatternConverter.cs
------------------------------------------------------------------------------
svn:eol-style = native
Modified: logging/log4net/trunk/src/Layout/Pattern/StackTraceDetailPatternConverter.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/src/Layout/Pattern/StackTraceDetailPatternConverter.cs?rev=1158529&r1=1158528&r2=1158529&view=diff
==============================================================================
--- logging/log4net/trunk/src/Layout/Pattern/StackTraceDetailPatternConverter.cs (original)
+++ logging/log4net/trunk/src/Layout/Pattern/StackTraceDetailPatternConverter.cs Wed Aug 17 05:57:00 2011
@@ -1,90 +1,90 @@
-using System;
-using System.Collections;
-using System.Text;
-
-using log4net.Util;
-using log4net.Core;
-
-namespace log4net.Layout.Pattern
-{
- /// <summary>
- /// Write the caller stack frames to the output
- /// </summary>
- /// <remarks>
- /// <para>
- /// Writes the <see cref="LocationInfo.StackFrames"/> to the output writer, using format:
- /// type3.MethodCall3(type param,...) > type2.MethodCall2(type param,...) > type1.MethodCall1(type param,...)
- /// </para>
- /// </remarks>
- /// <author>Adam Davies</author>
- internal class StackTraceDetailPatternConverter : StackTracePatternConverter
- {
- internal override string GetMethodInformation(System.Reflection.MethodBase method)
- {
- string returnValue="";
-
- try
- {
- string param = "";
- string[] names = GetMethodParameterNames(method);
- StringBuilder sb = new StringBuilder();
- if (names != null && names.GetUpperBound(0) > 0)
- {
- for (int i = 0; i <= names.GetUpperBound(0); i++)
- {
- sb.AppendFormat("{0}, ", names[i]);
- }
- }
-
- if (sb.Length > 0)
- {
- sb.Remove(sb.Length - 2, 2);
- param = sb.ToString();
- }
-
- returnValue=base.GetMethodInformation(method) + "(" + param + ")";
- }
- catch (Exception ex)
- {
- LogLog.Error(declaringType, "An exception ocurred while retreiving method information.", ex);
- }
-
- return returnValue;
- }
-
- private string[] GetMethodParameterNames(System.Reflection.MethodBase methodBase)
- {
- ArrayList methodParameterNames = new ArrayList();
- try
- {
- System.Reflection.ParameterInfo[] methodBaseGetParameters = methodBase.GetParameters();
-
- int methodBaseGetParametersCount = methodBaseGetParameters.GetUpperBound(0);
-
- for (int i = 0; i <= methodBaseGetParametersCount; i++)
- {
- methodParameterNames.Add(methodBaseGetParameters[i].ParameterType + " " + methodBaseGetParameters[i].Name);
- }
- }
- catch (Exception ex)
- {
- LogLog.Error(declaringType, "An exception ocurred while retreiving method parameters.", ex);
- }
-
- return (string[])methodParameterNames.ToArray(typeof (string));
- }
-
- #region Private Static Fields
-
- /// <summary>
- /// The fully qualified type of the StackTraceDetailPatternConverter class.
- /// </summary>
- /// <remarks>
- /// Used by the internal logger to record the Type of the
- /// log message.
- /// </remarks>
- private readonly static Type declaringType = typeof(StackTracePatternConverter);
-
- #endregion Private Static Fields
- }
-}
+using System;
+using System.Collections;
+using System.Text;
+
+using log4net.Util;
+using log4net.Core;
+
+namespace log4net.Layout.Pattern
+{
+ /// <summary>
+ /// Write the caller stack frames to the output
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// Writes the <see cref="LocationInfo.StackFrames"/> to the output writer, using format:
+ /// type3.MethodCall3(type param,...) > type2.MethodCall2(type param,...) > type1.MethodCall1(type param,...)
+ /// </para>
+ /// </remarks>
+ /// <author>Adam Davies</author>
+ internal class StackTraceDetailPatternConverter : StackTracePatternConverter
+ {
+ internal override string GetMethodInformation(System.Reflection.MethodBase method)
+ {
+ string returnValue="";
+
+ try
+ {
+ string param = "";
+ string[] names = GetMethodParameterNames(method);
+ StringBuilder sb = new StringBuilder();
+ if (names != null && names.GetUpperBound(0) > 0)
+ {
+ for (int i = 0; i <= names.GetUpperBound(0); i++)
+ {
+ sb.AppendFormat("{0}, ", names[i]);
+ }
+ }
+
+ if (sb.Length > 0)
+ {
+ sb.Remove(sb.Length - 2, 2);
+ param = sb.ToString();
+ }
+
+ returnValue=base.GetMethodInformation(method) + "(" + param + ")";
+ }
+ catch (Exception ex)
+ {
+ LogLog.Error(declaringType, "An exception ocurred while retreiving method information.", ex);
+ }
+
+ return returnValue;
+ }
+
+ private string[] GetMethodParameterNames(System.Reflection.MethodBase methodBase)
+ {
+ ArrayList methodParameterNames = new ArrayList();
+ try
+ {
+ System.Reflection.ParameterInfo[] methodBaseGetParameters = methodBase.GetParameters();
+
+ int methodBaseGetParametersCount = methodBaseGetParameters.GetUpperBound(0);
+
+ for (int i = 0; i <= methodBaseGetParametersCount; i++)
+ {
+ methodParameterNames.Add(methodBaseGetParameters[i].ParameterType + " " + methodBaseGetParameters[i].Name);
+ }
+ }
+ catch (Exception ex)
+ {
+ LogLog.Error(declaringType, "An exception ocurred while retreiving method parameters.", ex);
+ }
+
+ return (string[])methodParameterNames.ToArray(typeof (string));
+ }
+
+ #region Private Static Fields
+
+ /// <summary>
+ /// The fully qualified type of the StackTraceDetailPatternConverter class.
+ /// </summary>
+ /// <remarks>
+ /// Used by the internal logger to record the Type of the
+ /// log message.
+ /// </remarks>
+ private readonly static Type declaringType = typeof(StackTracePatternConverter);
+
+ #endregion Private Static Fields
+ }
+}
Propchange: logging/log4net/trunk/src/Layout/Pattern/StackTraceDetailPatternConverter.cs
------------------------------------------------------------------------------
svn:eol-style = native