1JavaMap(3) User Contributed Perl Documentation JavaMap(3)
2
3
4
6 Log::Log4perl::JavaMap - maps java log4j appenders to Log::Dispatch
7 classes
8
10 ###############################
11 log4j.appender.FileAppndr1 = org.apache.log4j.FileAppender
12 log4j.appender.FileAppndr1.File = /var/log/onetime.log
13 log4j.appender.FileAppndr1.Append = false
14
15 log4j.appender.FileAppndr1.layout = org.apache.log4j.PatternLayout
16 log4j.appender.FileAppndr1.layout.ConversionPattern=%d %4r [%t] %-5p %c %x - %m%n
17 ###############################
18
20 If somebody wants to create an appender called "org.apache.log4j.Con‐
21 soleAppender", we want to translate it to Log::Dispatch::Screen, and
22 then translate the log4j options into Log::Dispatch parameters..
23
24 What's Implemented
25
26 (Note that you can always use the Log::Dispatch::* module. By 'imple‐
27 mented' I mean having a translation class that translates log4j options
28 into the Log::Dispatch options so you can use log4j rather than
29 log4perl syntax in your config file.)
30
31 Here's the list of appenders I see on the current (6/2002) log4j site.
32
33 These are implemented
34
35 ConsoleAppender - Log::Dispatch::Screen
36 FileAppender - Log::Dispatch::File
37 RollingFileAppender - Log::Dispatch::FileRotate (by Mark Pfeiffer)
38 JDBCAppender - Log::Log4perl::Appender::DBI
39 SyslogAppender - Log::Dispatch::Syslog
40 NTEventLogAppender - Log::Dispatch::Win32EventLog
41
42 These should/will/might be implemented
43
44 DailyRollingFileAppender -
45 SMTPAppender - Log::Dispatch::Email::MailSender
46
47 These might be implemented but they don't have corresponding classes in
48 Log::Dispatch (yet):
49
50 NullAppender
51 TelnetAppender
52
53 These might be simulated
54
55 LF5Appender - use Tk?
56 ExternallyRolledFileAppender - catch a HUP instead?
57
58 These will probably not be implemented
59
60 AsyncAppender
61 JMSAppender
62 SocketAppender - (ships a serialized LoggingEvent to the server side)
63 SocketHubAppender
64
66 Let's say you've in a mixed Java/Perl enviroment and you've come up
67 with some custom Java appender with behavior you want to use in both
68 worlds, "myorg.customAppender". You write a Perl appender with the
69 same behavior "Myorg::CustomAppender". You want to use one config file
70 accross both applications, so the config file will have to say
71 'myorg.customAppender'. But the mapping from "myorg.customAppender" to
72 "Myorg::CustomAppender" isn't in this JavaMap class, so what do you do?
73
74 In your Perl code, before you call Log::Log4perl::init(), do this:
75
76 $Log::Log4perl::JavaMap::user_defined{'myorg.customAppender'} =
77 'Myorg::CustomAppender';
78
79 and you can use 'myorg.customAppender' in your config file with
80 impunity.
81
83 Kevin Goess, <cpan@goess.org>
84 Mike Schilli, <m@perlmeister.com>
85
86 June, 2002
87
89 http://jakarta.apache.org/log4j/docs/
90
91
92
93perl v5.8.8 2002-07-10 JavaMap(3)