log4r 1.1.6 → 1.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README +3 -3
- data/Rakefile +2 -2
- data/doc/rdoc/Log4r.html +519 -0
- data/doc/rdoc/Log4r/BasicFormatter.html +388 -0
- data/doc/rdoc/Log4r/ConfigError.html +225 -0
- data/doc/rdoc/Log4r/Configurator.html +1068 -0
- data/doc/rdoc/Log4r/DateFileOutputter.html +479 -0
- data/doc/rdoc/Log4r/DefaultFormatter.html +223 -0
- data/doc/rdoc/Log4r/EmailOutputter.html +654 -0
- data/doc/rdoc/Log4r/FileOutputter.html +346 -0
- data/doc/rdoc/Log4r/Formatter.html +309 -0
- data/doc/rdoc/Log4r/GDC.html +346 -0
- data/doc/rdoc/Log4r/GDC_rb.html +80 -0
- data/doc/rdoc/Log4r/IOOutputter.html +410 -0
- data/doc/rdoc/Log4r/Log4jXmlFormatter.html +337 -0
- data/doc/rdoc/Log4r/Log4rConfig.html +211 -0
- data/doc/rdoc/Log4r/Log4rTools.html +388 -0
- data/doc/rdoc/Log4r/LogEvent.html +378 -0
- data/doc/rdoc/Log4r/LogServer.html +340 -0
- data/doc/rdoc/Log4r/Logger.html +1150 -0
- data/doc/rdoc/Log4r/Logger/LoggerFactory.html +218 -0
- data/doc/rdoc/Log4r/Logger/Repository.html +225 -0
- data/doc/rdoc/Log4r/MDC.html +424 -0
- data/doc/rdoc/Log4r/MDC_rb.html +83 -0
- data/doc/rdoc/Log4r/NDC.html +632 -0
- data/doc/rdoc/Log4r/NDC_rb.html +110 -0
- data/doc/rdoc/Log4r/ObjectFormatter.html +280 -0
- data/doc/rdoc/Log4r/Outputter.html +934 -0
- data/doc/rdoc/Log4r/Outputter/OutputterFactory.html +218 -0
- data/doc/rdoc/Log4r/Outputter/consoleoutputters_rb.html +57 -0
- data/doc/rdoc/Log4r/Outputter/datefileoutputter_rb.html +93 -0
- data/doc/rdoc/Log4r/Outputter/emailoutputter_rb.html +179 -0
- data/doc/rdoc/Log4r/Outputter/fileoutputter_rb.html +64 -0
- data/doc/rdoc/Log4r/Outputter/iooutputter_rb.html +59 -0
- data/doc/rdoc/Log4r/Outputter/outputter_rb.html +222 -0
- data/doc/rdoc/Log4r/Outputter/outputterfactory_rb.html +62 -0
- data/doc/rdoc/Log4r/Outputter/remoteoutputter_rb.html +59 -0
- data/doc/rdoc/Log4r/Outputter/rollingfileoutputter_rb.html +66 -0
- data/doc/rdoc/Log4r/Outputter/staticoutputter_rb.html +55 -0
- data/doc/rdoc/Log4r/Outputter/syslogoutputter_rb.html +110 -0
- data/doc/rdoc/Log4r/Outputter/udpoutputter_rb.html +220 -0
- data/doc/rdoc/Log4r/PatternFormatter.html +404 -0
- data/doc/rdoc/Log4r/ROMPClient.html +211 -0
- data/doc/rdoc/Log4r/ROMPServer.html +211 -0
- data/doc/rdoc/Log4r/RemoteOutputter.html +402 -0
- data/doc/rdoc/Log4r/RollingFileOutputter.html +551 -0
- data/doc/rdoc/Log4r/RootLogger.html +530 -0
- data/doc/rdoc/Log4r/SimpleFormatter.html +276 -0
- data/doc/rdoc/Log4r/StderrOutputter.html +268 -0
- data/doc/rdoc/Log4r/StdoutOutputter.html +268 -0
- data/doc/rdoc/Log4r/SyslogOutputter.html +551 -0
- data/doc/rdoc/Log4r/UDPOutputter.html +379 -0
- data/doc/rdoc/Log4r/YamlConfigurator.html +966 -0
- data/doc/rdoc/Log4r/base_rb.html +57 -0
- data/doc/rdoc/Log4r/config_rb.html +122 -0
- data/doc/rdoc/Log4r/configurator_rb.html +370 -0
- data/doc/rdoc/Log4r/formatter/formatter_rb.html +121 -0
- data/doc/rdoc/Log4r/formatter/log4jxmlformatter_rb.html +64 -0
- data/doc/rdoc/Log4r/formatter/patternformatter_rb.html +239 -0
- data/doc/rdoc/Log4r/lib/drbloader_rb.html +57 -0
- data/doc/rdoc/Log4r/lib/xmlloader_rb.html +57 -0
- data/doc/rdoc/Log4r/logevent_rb.html +55 -0
- data/doc/rdoc/Log4r/logger_rb.html +293 -0
- data/doc/rdoc/Log4r/loggerfactory_rb.html +66 -0
- data/doc/rdoc/Log4r/logserver_rb.html +161 -0
- data/doc/rdoc/Log4r/rdoc/GDC.html +175 -0
- data/doc/rdoc/Log4r/rdoc/MDC.html +178 -0
- data/doc/rdoc/Log4r/rdoc/NDC.html +207 -0
- data/doc/rdoc/Log4r/rdoc/configurator.html +462 -0
- data/doc/rdoc/Log4r/rdoc/emailoutputter.html +279 -0
- data/doc/rdoc/Log4r/rdoc/formatter.html +218 -0
- data/doc/rdoc/Log4r/rdoc/log4r.html +286 -0
- data/doc/rdoc/Log4r/rdoc/logger.html +382 -0
- data/doc/rdoc/Log4r/rdoc/logserver.html +265 -0
- data/doc/rdoc/Log4r/rdoc/outputter.html +313 -0
- data/doc/rdoc/Log4r/rdoc/patternformatter.html +331 -0
- data/doc/rdoc/Log4r/rdoc/syslogoutputter.html +197 -0
- data/doc/rdoc/Log4r/rdoc/win32eventoutputter.html +165 -0
- data/doc/rdoc/Log4r/rdoc/yamlconfigurator.html +187 -0
- data/doc/rdoc/Log4r/repository_rb.html +74 -0
- data/doc/rdoc/Log4r/staticlogger_rb.html +55 -0
- data/doc/rdoc/Log4r/yamlconfigurator_rb.html +95 -0
- data/doc/rdoc/REXML.html +211 -0
- data/doc/rdoc/created.rid +1 -0
- data/doc/rdoc/images/brick.png +0 -0
- data/doc/rdoc/images/brick_link.png +0 -0
- data/doc/rdoc/images/bug.png +0 -0
- data/doc/rdoc/images/bullet_black.png +0 -0
- data/doc/rdoc/images/bullet_toggle_minus.png +0 -0
- data/doc/rdoc/images/bullet_toggle_plus.png +0 -0
- data/doc/rdoc/images/date.png +0 -0
- data/doc/rdoc/images/find.png +0 -0
- data/doc/rdoc/images/loadingAnimation.gif +0 -0
- data/doc/rdoc/images/macFFBgHack.png +0 -0
- data/doc/rdoc/images/package.png +0 -0
- data/doc/rdoc/images/page_green.png +0 -0
- data/doc/rdoc/images/page_white_text.png +0 -0
- data/doc/rdoc/images/page_white_width.png +0 -0
- data/doc/rdoc/images/plugin.png +0 -0
- data/doc/rdoc/images/ruby.png +0 -0
- data/doc/rdoc/images/tag_green.png +0 -0
- data/doc/rdoc/images/wrench.png +0 -0
- data/doc/rdoc/images/wrench_orange.png +0 -0
- data/doc/rdoc/images/zoom.png +0 -0
- data/doc/rdoc/index.html +585 -0
- data/doc/rdoc/js/darkfish.js +116 -0
- data/doc/rdoc/js/jquery.js +32 -0
- data/doc/rdoc/js/quicksearch.js +114 -0
- data/doc/rdoc/js/thickbox-compressed.js +10 -0
- data/doc/rdoc/log4r-rdoc.css +696 -0
- data/doc/rdoc/log4r_rb.html +207 -0
- data/doc/rdoc/rdoc.css +696 -0
- data/examples/rdoc-gen +2 -0
- data/src/log4r.rb +2 -2
- data/src/log4r/formatter/patternformatter.rb +15 -15
- data/src/log4r/outputter/udpoutputter.rb +4 -4
- data/tests/testchainsaw.rb +1 -1
- metadata +123 -8
- data/src/log4r/outputter/datefileoutputter.patch +0 -24
- data/src/log4r/outputter/diff +0 -14
- 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
|
+
<tt>require 'log4r/outputter/syslogoutputter'</tt>
|
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("name", 'logopt'=>#, 'facility'=>#)
|
76
|
+
syslog.err("this is an ERR message")
|
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' => Create 'console' outputter
|
81
|
+
Outputter['console'] => 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 ‘stdout’ and ‘stderr’ are
|
145
|
+
created automatically at the root level. They are nice shortcuts.
|
146
|
+
</p>
|
147
|
+
<pre>
|
148
|
+
Outputter['stdout'] => 'stdout'
|
149
|
+
Outputter['stderr'] => 'stderr'
|
150
|
+
Outputter.stdout => 'stdout'
|
151
|
+
Outputter.stderr => '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' => WARN,
|
171
|
+
:formatter => 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><log4r_config></tt>:
|
181
|
+
</p>
|
182
|
+
<pre>
|
183
|
+
<log4r_config>
|
184
|
+
<outputter name="myout" type="Log4r::StdoutOutputter">
|
185
|
+
<only_at>DEBUG, INFO</only_at>
|
186
|
+
</outputter>
|
187
|
+
<outputter name="file" level="WARN">
|
188
|
+
<type>FileOutputter</type>
|
189
|
+
<filename>#{logpath}/file.log</filename>
|
190
|
+
<trunc>false</trunc>
|
191
|
+
</outputter>
|
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
|
+
|