IAppender.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #region Apache License
  2. //
  3. // Licensed to the Apache Software Foundation (ASF) under one or more
  4. // contributor license agreements. See the NOTICE file distributed with
  5. // this work for additional information regarding copyright ownership.
  6. // The ASF licenses this file to you under the Apache License, Version 2.0
  7. // (the "License"); you may not use this file except in compliance with
  8. // the License. You may obtain a copy of the License at
  9. //
  10. // http://www.apache.org/licenses/LICENSE-2.0
  11. //
  12. // Unless required by applicable law or agreed to in writing, software
  13. // distributed under the License is distributed on an "AS IS" BASIS,
  14. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. // See the License for the specific language governing permissions and
  16. // limitations under the License.
  17. //
  18. #endregion
  19. using log4net.Filter;
  20. using log4net.Layout;
  21. using log4net.Core;
  22. namespace log4net.Appender
  23. {
  24. /// <summary>
  25. /// Implement this interface for your own strategies for printing log statements.
  26. /// </summary>
  27. /// <remarks>
  28. /// <para>
  29. /// Implementors should consider extending the <see cref="AppenderSkeleton"/>
  30. /// class which provides a default implementation of this interface.
  31. /// </para>
  32. /// <para>
  33. /// Appenders can also implement the <see cref="IOptionHandler"/> interface. Therefore
  34. /// they would require that the <see cref="M:IOptionHandler.ActivateOptions()"/> method
  35. /// be called after the appenders properties have been configured.
  36. /// </para>
  37. /// </remarks>
  38. /// <author>Nicko Cadell</author>
  39. /// <author>Gert Driesen</author>
  40. public interface IAppender
  41. {
  42. /// <summary>
  43. /// Closes the appender and releases resources.
  44. /// </summary>
  45. /// <remarks>
  46. /// <para>
  47. /// Releases any resources allocated within the appender such as file handles,
  48. /// network connections, etc.
  49. /// </para>
  50. /// <para>
  51. /// It is a programming error to append to a closed appender.
  52. /// </para>
  53. /// </remarks>
  54. void Close();
  55. /// <summary>
  56. /// Log the logging event in Appender specific way.
  57. /// </summary>
  58. /// <param name="loggingEvent">The event to log</param>
  59. /// <remarks>
  60. /// <para>
  61. /// This method is called to log a message into this appender.
  62. /// </para>
  63. /// </remarks>
  64. void DoAppend(LoggingEvent loggingEvent);
  65. /// <summary>
  66. /// Gets or sets the name of this appender.
  67. /// </summary>
  68. /// <value>The name of the appender.</value>
  69. /// <remarks>
  70. /// <para>The name uniquely identifies the appender.</para>
  71. /// </remarks>
  72. string Name { get; set; }
  73. }
  74. }