The Tivoli log file adapter reads a file where its information is delimited by 
colons:
severity, hostname, Application, Instance, Program, Message.

Using a pattern layout I can create this entry as in (actually SYSLOG is 
writing into Tivoli file)

log4perl.appender.SYSLOG           = Log::Dispatch::Syslog
log4perl.appender.SYSLOG.Threshold = WARN
log4perl.appender.SYSLOG.facility  = local2
log4perl.appender.SYSLOG.ident     = 'tivoli'
log4perl.appender.SYSLOG.layout    = Log::Log4perl::Layout::PatternLayout
log4perl.appender.SYSLOG.layout.cspec.E = sub { return 'MINOR' if $_[3] eq 
'WARN' }
log4perl.appender.SYSLOG.layout.ConversionPattern=:%E:%H:%X{sx_Appl}:%X{sx_Inst}:
 %F %m%n

but I am struggling with mapping Log4Perl severities to Tivoli severities.
I tried the above cspec.E but I am getting the following error

Argument "srp03443ax.juliusbaer.com" isn't numeric in sprintf at 
/u01/app/perl/lib/perl5/site_perl/5.16.3/Log/Log4perl/Layout/PatternLayout.pm 
line 307.
Missing argument in sprintf at 
/u01/app/perl/lib/perl5/site_perl/5.16.3/Log/Log4perl/Layout/PatternLayout.pm 
line 307.

when executig
#!/u01/app/perl/bin/perl
use warnings;
use strict;
use Log::Log4perl qw(get_logger);

Log::Log4perl::init( '/u01/app/amh/UserProvisioning/testing.conf' );
Log::Log4perl::MDC->put('sx_Appl', 'BCOM');
Log::Log4perl::MDC->put('sx_Inst', 'AMH');
my $logger = get_logger("");
$logger->warn("Testing");


Any help is greatly appreciated.
Regards
Markus
_____________________________________________________________
Dr. Markus Sonderegger
Application Integration
Bank Julius Baer & Co. Ltd.
Hohlstrasse 600, P.O. Box, CH-8010 Zurich, Switzerland
Telephone +41 58 88 77281, Telefax +41 58 88 74851
Mobile Phone +41 79 698 09 79
www.juliusbaer.com<http://www.juliusbaer.com>

Julius Baer cares about the environment: Please do not print this e-mail unless 
you really need to.



*****JuliusBaer Disclaimer***** This e-mail is for the intended recipient only 
and may contain confidential or privileged information. If you have received 
this e-mail by mistake, please contact us immediately and completely delete it 
(and any attachments) and do not forward it or inform any other person of its 
contents. If you send us messages by e-mail, we take this as your authorisation 
to correspond with you by e-mail, however, we reserve the right not to execute 
orders and instructions transmitted by e-mail at any time and without further 
explanation. If you do not wish to receive any further e-mail correspondence 
please let us know. E-mail transmission cannot be guaranteed to be secure or 
error-free as information could be intercepted, amended, corrupted, lost, 
destroyed, arrive late or incomplete, or contain viruses. Neither the Julius 
Baer Group nor the sender accept liability for any errors or omissions in the 
content of this message which arise as a result of its e-mail transmission. 
Please note that all e-mail communications to and from the Julius Baer Group 
may be monitored. This communication is for informational purposes only. It is 
not intended as an offer or solicitation for the purchase or sale of any 
financial instrument or as an official confirmation of any transaction.
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.  Get 
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
log4perl-devel mailing list
log4perl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/log4perl-devel

Reply via email to