log4r 1.1.6 → 1.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. data/README +3 -3
  2. data/Rakefile +2 -2
  3. data/doc/rdoc/Log4r.html +519 -0
  4. data/doc/rdoc/Log4r/BasicFormatter.html +388 -0
  5. data/doc/rdoc/Log4r/ConfigError.html +225 -0
  6. data/doc/rdoc/Log4r/Configurator.html +1068 -0
  7. data/doc/rdoc/Log4r/DateFileOutputter.html +479 -0
  8. data/doc/rdoc/Log4r/DefaultFormatter.html +223 -0
  9. data/doc/rdoc/Log4r/EmailOutputter.html +654 -0
  10. data/doc/rdoc/Log4r/FileOutputter.html +346 -0
  11. data/doc/rdoc/Log4r/Formatter.html +309 -0
  12. data/doc/rdoc/Log4r/GDC.html +346 -0
  13. data/doc/rdoc/Log4r/GDC_rb.html +80 -0
  14. data/doc/rdoc/Log4r/IOOutputter.html +410 -0
  15. data/doc/rdoc/Log4r/Log4jXmlFormatter.html +337 -0
  16. data/doc/rdoc/Log4r/Log4rConfig.html +211 -0
  17. data/doc/rdoc/Log4r/Log4rTools.html +388 -0
  18. data/doc/rdoc/Log4r/LogEvent.html +378 -0
  19. data/doc/rdoc/Log4r/LogServer.html +340 -0
  20. data/doc/rdoc/Log4r/Logger.html +1150 -0
  21. data/doc/rdoc/Log4r/Logger/LoggerFactory.html +218 -0
  22. data/doc/rdoc/Log4r/Logger/Repository.html +225 -0
  23. data/doc/rdoc/Log4r/MDC.html +424 -0
  24. data/doc/rdoc/Log4r/MDC_rb.html +83 -0
  25. data/doc/rdoc/Log4r/NDC.html +632 -0
  26. data/doc/rdoc/Log4r/NDC_rb.html +110 -0
  27. data/doc/rdoc/Log4r/ObjectFormatter.html +280 -0
  28. data/doc/rdoc/Log4r/Outputter.html +934 -0
  29. data/doc/rdoc/Log4r/Outputter/OutputterFactory.html +218 -0
  30. data/doc/rdoc/Log4r/Outputter/consoleoutputters_rb.html +57 -0
  31. data/doc/rdoc/Log4r/Outputter/datefileoutputter_rb.html +93 -0
  32. data/doc/rdoc/Log4r/Outputter/emailoutputter_rb.html +179 -0
  33. data/doc/rdoc/Log4r/Outputter/fileoutputter_rb.html +64 -0
  34. data/doc/rdoc/Log4r/Outputter/iooutputter_rb.html +59 -0
  35. data/doc/rdoc/Log4r/Outputter/outputter_rb.html +222 -0
  36. data/doc/rdoc/Log4r/Outputter/outputterfactory_rb.html +62 -0
  37. data/doc/rdoc/Log4r/Outputter/remoteoutputter_rb.html +59 -0
  38. data/doc/rdoc/Log4r/Outputter/rollingfileoutputter_rb.html +66 -0
  39. data/doc/rdoc/Log4r/Outputter/staticoutputter_rb.html +55 -0
  40. data/doc/rdoc/Log4r/Outputter/syslogoutputter_rb.html +110 -0
  41. data/doc/rdoc/Log4r/Outputter/udpoutputter_rb.html +220 -0
  42. data/doc/rdoc/Log4r/PatternFormatter.html +404 -0
  43. data/doc/rdoc/Log4r/ROMPClient.html +211 -0
  44. data/doc/rdoc/Log4r/ROMPServer.html +211 -0
  45. data/doc/rdoc/Log4r/RemoteOutputter.html +402 -0
  46. data/doc/rdoc/Log4r/RollingFileOutputter.html +551 -0
  47. data/doc/rdoc/Log4r/RootLogger.html +530 -0
  48. data/doc/rdoc/Log4r/SimpleFormatter.html +276 -0
  49. data/doc/rdoc/Log4r/StderrOutputter.html +268 -0
  50. data/doc/rdoc/Log4r/StdoutOutputter.html +268 -0
  51. data/doc/rdoc/Log4r/SyslogOutputter.html +551 -0
  52. data/doc/rdoc/Log4r/UDPOutputter.html +379 -0
  53. data/doc/rdoc/Log4r/YamlConfigurator.html +966 -0
  54. data/doc/rdoc/Log4r/base_rb.html +57 -0
  55. data/doc/rdoc/Log4r/config_rb.html +122 -0
  56. data/doc/rdoc/Log4r/configurator_rb.html +370 -0
  57. data/doc/rdoc/Log4r/formatter/formatter_rb.html +121 -0
  58. data/doc/rdoc/Log4r/formatter/log4jxmlformatter_rb.html +64 -0
  59. data/doc/rdoc/Log4r/formatter/patternformatter_rb.html +239 -0
  60. data/doc/rdoc/Log4r/lib/drbloader_rb.html +57 -0
  61. data/doc/rdoc/Log4r/lib/xmlloader_rb.html +57 -0
  62. data/doc/rdoc/Log4r/logevent_rb.html +55 -0
  63. data/doc/rdoc/Log4r/logger_rb.html +293 -0
  64. data/doc/rdoc/Log4r/loggerfactory_rb.html +66 -0
  65. data/doc/rdoc/Log4r/logserver_rb.html +161 -0
  66. data/doc/rdoc/Log4r/rdoc/GDC.html +175 -0
  67. data/doc/rdoc/Log4r/rdoc/MDC.html +178 -0
  68. data/doc/rdoc/Log4r/rdoc/NDC.html +207 -0
  69. data/doc/rdoc/Log4r/rdoc/configurator.html +462 -0
  70. data/doc/rdoc/Log4r/rdoc/emailoutputter.html +279 -0
  71. data/doc/rdoc/Log4r/rdoc/formatter.html +218 -0
  72. data/doc/rdoc/Log4r/rdoc/log4r.html +286 -0
  73. data/doc/rdoc/Log4r/rdoc/logger.html +382 -0
  74. data/doc/rdoc/Log4r/rdoc/logserver.html +265 -0
  75. data/doc/rdoc/Log4r/rdoc/outputter.html +313 -0
  76. data/doc/rdoc/Log4r/rdoc/patternformatter.html +331 -0
  77. data/doc/rdoc/Log4r/rdoc/syslogoutputter.html +197 -0
  78. data/doc/rdoc/Log4r/rdoc/win32eventoutputter.html +165 -0
  79. data/doc/rdoc/Log4r/rdoc/yamlconfigurator.html +187 -0
  80. data/doc/rdoc/Log4r/repository_rb.html +74 -0
  81. data/doc/rdoc/Log4r/staticlogger_rb.html +55 -0
  82. data/doc/rdoc/Log4r/yamlconfigurator_rb.html +95 -0
  83. data/doc/rdoc/REXML.html +211 -0
  84. data/doc/rdoc/created.rid +1 -0
  85. data/doc/rdoc/images/brick.png +0 -0
  86. data/doc/rdoc/images/brick_link.png +0 -0
  87. data/doc/rdoc/images/bug.png +0 -0
  88. data/doc/rdoc/images/bullet_black.png +0 -0
  89. data/doc/rdoc/images/bullet_toggle_minus.png +0 -0
  90. data/doc/rdoc/images/bullet_toggle_plus.png +0 -0
  91. data/doc/rdoc/images/date.png +0 -0
  92. data/doc/rdoc/images/find.png +0 -0
  93. data/doc/rdoc/images/loadingAnimation.gif +0 -0
  94. data/doc/rdoc/images/macFFBgHack.png +0 -0
  95. data/doc/rdoc/images/package.png +0 -0
  96. data/doc/rdoc/images/page_green.png +0 -0
  97. data/doc/rdoc/images/page_white_text.png +0 -0
  98. data/doc/rdoc/images/page_white_width.png +0 -0
  99. data/doc/rdoc/images/plugin.png +0 -0
  100. data/doc/rdoc/images/ruby.png +0 -0
  101. data/doc/rdoc/images/tag_green.png +0 -0
  102. data/doc/rdoc/images/wrench.png +0 -0
  103. data/doc/rdoc/images/wrench_orange.png +0 -0
  104. data/doc/rdoc/images/zoom.png +0 -0
  105. data/doc/rdoc/index.html +585 -0
  106. data/doc/rdoc/js/darkfish.js +116 -0
  107. data/doc/rdoc/js/jquery.js +32 -0
  108. data/doc/rdoc/js/quicksearch.js +114 -0
  109. data/doc/rdoc/js/thickbox-compressed.js +10 -0
  110. data/doc/rdoc/log4r-rdoc.css +696 -0
  111. data/doc/rdoc/log4r_rb.html +207 -0
  112. data/doc/rdoc/rdoc.css +696 -0
  113. data/examples/rdoc-gen +2 -0
  114. data/src/log4r.rb +2 -2
  115. data/src/log4r/formatter/patternformatter.rb +15 -15
  116. data/src/log4r/outputter/udpoutputter.rb +4 -4
  117. data/tests/testchainsaw.rb +1 -1
  118. metadata +123 -8
  119. data/src/log4r/outputter/datefileoutputter.patch +0 -24
  120. data/src/log4r/outputter/diff +0 -14
  121. data/src/log4r/outputter/new-datefileoutputter.rb +0 -117
@@ -0,0 +1,66 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+
5
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
+ <head>
7
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
8
+
9
+ <title>File: rollingfileoutputter.rb [1.1.7 Log4r API]</title>
10
+
11
+ <link type="text/css" media="screen" href="../../rdoc.css" rel="stylesheet" />
12
+
13
+ <script src="../../js/jquery.js" type="text/javascript"
14
+ charset="utf-8"></script>
15
+ <script src="../../js/thickbox-compressed.js" type="text/javascript"
16
+ charset="utf-8"></script>
17
+ <script src="../../js/quicksearch.js" type="text/javascript"
18
+ charset="utf-8"></script>
19
+ <script src="../../js/darkfish.js" type="text/javascript"
20
+ charset="utf-8"></script>
21
+ </head>
22
+
23
+ <body class="file file-popup">
24
+ <div id="metadata">
25
+ <dl>
26
+ <dt class="modified-date">Last Modified</dt>
27
+ <dd class="modified-date">Tue Sep 29 11:13:13 -0700 2009</dd>
28
+
29
+
30
+ <dt class="requires">Requires</dt>
31
+ <dd class="requires">
32
+ <ul>
33
+
34
+ <li>log4r/outputter/fileoutputter</li>
35
+
36
+ <li>log4r/staticlogger</li>
37
+
38
+ <li>log4r</li>
39
+
40
+ </ul>
41
+ </dd>
42
+
43
+
44
+
45
+ </dl>
46
+ </div>
47
+
48
+ <div id="documentation">
49
+
50
+ <div class="description">
51
+ <h2>Description</h2>
52
+ <p>
53
+ :nodoc:
54
+ </p>
55
+ <table>
56
+ <tr><td valign="top">Version:</td><td>$Id: rollingfileoutputter.rb,v 1.2 2009/09/29 18:13:13 colbygk Exp $
57
+
58
+ </td></tr>
59
+ </table>
60
+
61
+ </div>
62
+
63
+ </div>
64
+ </body>
65
+ </html>
66
+
@@ -0,0 +1,55 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+
5
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
+ <head>
7
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
8
+
9
+ <title>File: staticoutputter.rb [1.1.7 Log4r API]</title>
10
+
11
+ <link type="text/css" media="screen" href="../../rdoc.css" rel="stylesheet" />
12
+
13
+ <script src="../../js/jquery.js" type="text/javascript"
14
+ charset="utf-8"></script>
15
+ <script src="../../js/thickbox-compressed.js" type="text/javascript"
16
+ charset="utf-8"></script>
17
+ <script src="../../js/quicksearch.js" type="text/javascript"
18
+ charset="utf-8"></script>
19
+ <script src="../../js/darkfish.js" type="text/javascript"
20
+ charset="utf-8"></script>
21
+ </head>
22
+
23
+ <body class="file file-popup">
24
+ <div id="metadata">
25
+ <dl>
26
+ <dt class="modified-date">Last Modified</dt>
27
+ <dd class="modified-date">Thu Mar 18 19:31:10 -0800 2004</dd>
28
+
29
+
30
+ <dt class="requires">Requires</dt>
31
+ <dd class="requires">
32
+ <ul>
33
+
34
+ </ul>
35
+ </dd>
36
+
37
+
38
+
39
+ </dl>
40
+ </div>
41
+
42
+ <div id="documentation">
43
+
44
+ <div class="description">
45
+ <h2>Description</h2>
46
+ <p>
47
+ :nodoc:
48
+ </p>
49
+
50
+ </div>
51
+
52
+ </div>
53
+ </body>
54
+ </html>
55
+
@@ -0,0 +1,110 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+
5
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
+ <head>
7
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
8
+
9
+ <title>File: syslogoutputter.rb [1.1.7 Log4r API]</title>
10
+
11
+ <link type="text/css" media="screen" href="../../rdoc.css" rel="stylesheet" />
12
+
13
+ <script src="../../js/jquery.js" type="text/javascript"
14
+ charset="utf-8"></script>
15
+ <script src="../../js/thickbox-compressed.js" type="text/javascript"
16
+ charset="utf-8"></script>
17
+ <script src="../../js/quicksearch.js" type="text/javascript"
18
+ charset="utf-8"></script>
19
+ <script src="../../js/darkfish.js" type="text/javascript"
20
+ charset="utf-8"></script>
21
+ </head>
22
+
23
+ <body class="file file-popup">
24
+ <div id="metadata">
25
+ <dl>
26
+ <dt class="modified-date">Last Modified</dt>
27
+ <dd class="modified-date">Fri Sep 25 13:33:33 -0700 2009</dd>
28
+
29
+
30
+ <dt class="requires">Requires</dt>
31
+ <dd class="requires">
32
+ <ul>
33
+
34
+ <li>log4r/formatter/formatter</li>
35
+
36
+ <li>log4r/outputter/outputter</li>
37
+
38
+ <li>log4r/configurator</li>
39
+
40
+ <li>syslog</li>
41
+
42
+ </ul>
43
+ </dd>
44
+
45
+
46
+
47
+ </dl>
48
+ </div>
49
+
50
+ <div id="documentation">
51
+
52
+ <div class="description">
53
+ <h2>Description</h2>
54
+ <h1>SyslogOutputter</h1>
55
+ <p>
56
+ A SyslogOutputter transforms a <a
57
+ href="../../Log4r/LogEvent.html">Log4r::LogEvent</a> into a call to
58
+ syslog(). Since syslog has its own formatting system, log4r formatters are
59
+ ignored.
60
+ </p>
61
+ <h2>Usage</h2>
62
+ <p>
63
+ To use,
64
+ </p>
65
+ <pre>
66
+ &lt;tt&gt;require 'log4r/outputter/syslogoutputter'&lt;/tt&gt;
67
+ </pre>
68
+ <p>
69
+ An example,
70
+ </p>
71
+ <pre>
72
+ require 'log4r'
73
+ require 'log4r/outputter/syslogoutputter'
74
+
75
+ syslog = Log4r::SyslogOutputter.new(&quot;name&quot;, 'logopt'=&gt;#, 'facility'=&gt;#)
76
+ syslog.err(&quot;this is an ERR message&quot;)
77
+ </pre>
78
+ <p>
79
+ The output in <tt>/var/logs/syslog</tt> (Debian) is,
80
+ </p>
81
+ <pre>
82
+ Sep 3 11:43:06 tiphares sys[1603]: this is an ERR message
83
+ </pre>
84
+ <p>
85
+ The hash arguments <tt>logoptions</tt> and <tt>facility</tt> are passed to
86
+ <tt>Syslog.open</tt>. The defaults are <tt>LOG_PID | LOG_CONS</tt> and
87
+ <tt>LOG_USER</tt> respectively.
88
+ </p>
89
+ <p>
90
+ This is a first try implementation. It works well. Please report any bugs
91
+ and fixes.
92
+ </p>
93
+ <table>
94
+ <tr><td valign="top">Version:</td><td>$Id: syslogoutputter.rb,v 1.5 2009/09/25 20:33:33 colbygk Exp $
95
+
96
+ </td></tr>
97
+ <tr><td valign="top">Author:</td><td>Steve Lumos
98
+
99
+ </td></tr>
100
+ <tr><td valign="top">Author:</td><td>Leon Torres
101
+
102
+ </td></tr>
103
+ </table>
104
+
105
+ </div>
106
+
107
+ </div>
108
+ </body>
109
+ </html>
110
+
@@ -0,0 +1,220 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+
5
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
+ <head>
7
+ <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
8
+
9
+ <title>File: udpoutputter.rb [1.1.7 Log4r API]</title>
10
+
11
+ <link type="text/css" media="screen" href="../../rdoc.css" rel="stylesheet" />
12
+
13
+ <script src="../../js/jquery.js" type="text/javascript"
14
+ charset="utf-8"></script>
15
+ <script src="../../js/thickbox-compressed.js" type="text/javascript"
16
+ charset="utf-8"></script>
17
+ <script src="../../js/quicksearch.js" type="text/javascript"
18
+ charset="utf-8"></script>
19
+ <script src="../../js/darkfish.js" type="text/javascript"
20
+ charset="utf-8"></script>
21
+ </head>
22
+
23
+ <body class="file file-popup">
24
+ <div id="metadata">
25
+ <dl>
26
+ <dt class="modified-date">Last Modified</dt>
27
+ <dd class="modified-date">Fri Mar 12 09:35:06 -0800 2010</dd>
28
+
29
+
30
+ <dt class="requires">Requires</dt>
31
+ <dd class="requires">
32
+ <ul>
33
+
34
+ <li>log4r/outputter/outputter</li>
35
+
36
+ <li>log4r/staticlogger</li>
37
+
38
+ <li>socket</li>
39
+
40
+ </ul>
41
+ </dd>
42
+
43
+
44
+
45
+ </dl>
46
+ </div>
47
+
48
+ <div id="documentation">
49
+
50
+ <div class="description">
51
+ <h2>Description</h2>
52
+ <h1>Outputters</h1>
53
+ <p>
54
+ An Outputter is a logging destination with a particular way to format data.
55
+ It has a level threshold and a flexible level mask.
56
+ </p>
57
+ <p>
58
+ Outputters must have names.
59
+ </p>
60
+ <h2>Level Threshold</h2>
61
+ <p>
62
+ Outputters have their own level thresholds that default to <tt>root</tt>
63
+ level. They will not write any log events with a rank less than their
64
+ threshold.
65
+ </p>
66
+ <h2>Level Mask</h2>
67
+ <p>
68
+ Alternatively, an Outputter can be told to log specific levels only:
69
+ </p>
70
+ <pre>
71
+ o = StdoutOutputter.new 'console'
72
+ o.only_at DEBUG, FATAL # only DEBUG and FATAL get written
73
+ </pre>
74
+ <h2>Outputter Repository</h2>
75
+ <p>
76
+ When outputters are created, they store themselves in an Outputter
77
+ repository similar to the Logger repository.
78
+ </p>
79
+ <pre>
80
+ StdoutOutputter.new 'console' =&gt; Create 'console' outputter
81
+ Outputter['console'] =&gt; Get it back from the stash.
82
+ </pre>
83
+ <h2>Formatter</h2>
84
+ <p>
85
+ An outputter has a format defined by its Formatter. If no Formatter is
86
+ specified, DefaultFormatter will be used.
87
+ </p>
88
+ <h2>Outputter is Abstract</h2>
89
+ <p>
90
+ The basic Outputter class is both abstract and a null object.
91
+ </p>
92
+ <h2>Interesting Outputters</h2>
93
+ <ul>
94
+ <li><a href="syslogoutputter_rb.html">log4r/outputter/syslogoutputter.rb</a> -
95
+ Logs to syslog
96
+
97
+ </li>
98
+ <li><a href="emailoutputter_rb.html">log4r/outputter/emailoutputter.rb</a> -
99
+ Email logs
100
+
101
+ </li>
102
+ <li><a href="../logserver_rb.html">log4r/logserver.rb</a> - For remote logging
103
+
104
+ </li>
105
+ </ul>
106
+ <h2>Subclasses</h2>
107
+ <ul>
108
+ <li><a href="../../Log4r/IOOutputter.html">Log4r::IOOutputter</a> - for any IO
109
+ object
110
+
111
+ </li>
112
+ <li><a href="../../Log4r/StdoutOutputter.html">Log4r::StdoutOutputter</a> -
113
+ $stdout
114
+
115
+ </li>
116
+ <li><a href="../../Log4r/StderrOutputter.html">Log4r::StderrOutputter</a> -
117
+ $stderr
118
+
119
+ </li>
120
+ <li><a href="../../Log4r/FileOutputter.html">Log4r::FileOutputter</a> - log to
121
+ a file
122
+
123
+ </li>
124
+ <li><a
125
+ href="../../Log4r/RollingFileOutputter.html">Log4r::RollingFileOutputter</a>
126
+ - log to a file and split it as it grows
127
+
128
+ </li>
129
+ <li><a href="../../Log4r/SyslogOutputter.html">Log4r::SyslogOutputter</a> -
130
+ logs to syslog
131
+
132
+ </li>
133
+ <li><a href="../../Log4r/EmailOutputter.html">Log4r::EmailOutputter</a> - email
134
+ logs
135
+
136
+ </li>
137
+ <li><a href="../../Log4r/RemoteOutputter.html">Log4r::RemoteOutputter</a> - for
138
+ remote logging
139
+
140
+ </li>
141
+ </ul>
142
+ <h2>Default Outputters</h2>
143
+ <p>
144
+ Two outputters named &#8216;stdout&#8217; and &#8216;stderr&#8217; are
145
+ created automatically at the root level. They are nice shortcuts.
146
+ </p>
147
+ <pre>
148
+ Outputter['stdout'] =&gt; 'stdout'
149
+ Outputter['stderr'] =&gt; 'stderr'
150
+ Outputter.stdout =&gt; 'stdout'
151
+ Outputter.stderr =&gt; 'stderr'
152
+ </pre>
153
+ <h2>Configuring</h2>
154
+ <p>
155
+ Outputters must have names and receive hash arguments. The parameter name
156
+ for the hash args can be either a symbol or a string. All defined
157
+ outputters accept <tt>:level</tt> and <tt>:formatter</tt> arguments. For
158
+ arguments specific to a convenience Outputter, please look at the class
159
+ description.
160
+ </p>
161
+ <p>
162
+ The level threshold, the levels to log at (only_at) and formatter can be
163
+ changed dynamically using the <tt>=</tt> methods.
164
+ </p>
165
+ <p>
166
+ As a collective example of all this, here are various ways to set up an
167
+ IOOutputter:
168
+ </p>
169
+ <pre>
170
+ IOOutputter.new ExoticIO.new 'exotic', 'level' =&gt; WARN,
171
+ :formatter =&gt; MyFormatter.new
172
+ # an equivalent way:
173
+ o = IOOutputter.new ExoticIO.new 'exotic'
174
+ o.level = WARN
175
+ o.formatter = MyFormatter # we can specify just the class
176
+ o.only_at = THIS, THAT
177
+ </pre>
178
+ <h2>XML Configuration</h2>
179
+ <p>
180
+ Specify outputters as children of <tt>&lt;log4r_config&gt;</tt>:
181
+ </p>
182
+ <pre>
183
+ &lt;log4r_config&gt;
184
+ &lt;outputter name=&quot;myout&quot; type=&quot;Log4r::StdoutOutputter&quot;&gt;
185
+ &lt;only_at&gt;DEBUG, INFO&lt;/only_at&gt;
186
+ &lt;/outputter&gt;
187
+ &lt;outputter name=&quot;file&quot; level=&quot;WARN&quot;&gt;
188
+ &lt;type&gt;FileOutputter&lt;/type&gt;
189
+ &lt;filename&gt;#{logpath}/file.log&lt;/filename&gt;
190
+ &lt;trunc&gt;false&lt;/trunc&gt;
191
+ &lt;/outputter&gt;
192
+ ...
193
+ </pre>
194
+ <p>
195
+ As explained in <a
196
+ href="../configurator_rb.html">log4r/configurator.rb</a>, the hash
197
+ arguments you would normally pass to <tt>new</tt> are specified as <em>XML
198
+ parameters</em>. It is given an IO object to write to, a Formatter to call,
199
+ and, optionally, levels to write at.
200
+ </p>
201
+ <p>
202
+ Outputters invoke print then flush on the wrapped IO object. If the IO
203
+ chokes, the Outputter will close the IO and set its level to <tt>OFF</tt>.
204
+ </p>
205
+ <h2>Other Info</h2>
206
+ <table>
207
+ <tr><td valign="top">Version:</td><td>$Id: udpoutputter.rb,v 1.3 2010/03/12 17:35:06 colbygk Exp $
208
+
209
+ </td></tr>
210
+ <tr><td valign="top">Author:</td><td>Leon Torres <leon@ugcs.caltech.edu>
211
+
212
+ </td></tr>
213
+ </table>
214
+
215
+ </div>
216
+
217
+ </div>
218
+ </body>
219
+ </html>
220
+