Sponsored Content
Top Forums Shell Programming and Scripting Capture all error message in Log file and send the Log file by email Post 302518669 by dgmm on Sunday 1st of May 2011 03:42:45 AM
Old 05-01-2011
Hi Chakrapani
Thanks for your reply, Do you think the grep will work even if it is buffer. Because the script is wrtiing to Logfile and I will be checking the same Logfile in the script. Even if for me ** is not imporant. But wanted to search by a pattern to find if there a error in Logfile.
Do you think the way I am doing is ok or is there a better way to capture all the errors.


Thanks
Dgmm
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sh Prgram to capture Log message.

Hi All, I have a log file which consists of log messages as follows -> GLOBALCALLID_CLUSTERID_B NEXT * , O(") CHARACTER JOINONBEHALFOF NEXT * , O(") CHARACTER Record 1: Rejected - Error on table IFA_MMV_CDR, column CDRRECORDTYPE.... (1 Reply)
Discussion started by: rahulrathod
1 Replies

2. Shell Programming and Scripting

capture nohup log file

Hi, I am running my script using nohup, but I am not able to capture the log file for that process could naybody please help... Here is what I am doing.... nohup ./script & 1>/home/user1/log.txt but I am not able to capture the log.....Is there anyother way I can capture the log... (2 Replies)
Discussion started by: mgirinath
2 Replies

3. Shell Programming and Scripting

Fishing out error message within a log file

Hi all, i have a log file that captures success or failure messges when i run a daily job. here is a sample of my log. 20060312 start successful successful failure failure 20060312 end i need to write a subroutine that opens up the log daily after my job completes to examine the log... (2 Replies)
Discussion started by: new2ss
2 Replies

4. Shell Programming and Scripting

error-when trying to send the message thru email.

Hi All, I want to send a message through email. I have written below code. But it is not worling. Anybody has idea, why it is not working?. export $file1=$home1/pip1.$$ mailx -s "This Message from unix" abc@yahoo.com< $file1 thanks,Mary. (5 Replies)
Discussion started by: MARY76
5 Replies

5. Shell Programming and Scripting

how to send contents of a file to email as a message

i have a file new1.txt i want to send the contents of that file as a message to email ali@sms.com i m using ksh script......... plz help me (5 Replies)
Discussion started by: ali560045
5 Replies

6. Shell Programming and Scripting

Send-file /var/log/message

Hello All i need Shell Script to send /var/log/message or another if he have or grep this file to have some info like PID or value (e.g like NFS mount - stop ) to some body in my System Thanks for Advanced (2 Replies)
Discussion started by: Hosam
2 Replies

7. Shell Programming and Scripting

How to capture output to log file

Hi I have a script that will run multiple unix & sql commands. I want to see the output as well as capture it to a log file for further analysis. Is there an easy way to do that instead of adding "tee -a logfile" on everyline or even on the execute line (i.e. script | tee -s logfile). Thanks (1 Reply)
Discussion started by: nimo
1 Replies

8. Shell Programming and Scripting

format log file and send in email.

Hi guys i have one script which is as below do some sqlplus output in to $LOG sed '/^$/d' $LOG > /tmp/job.log mv /tmp/job.log $LOG awk '{if ($5=="COMPLETED") {print "backup completed at "$3" "$4 " of " $6 " for " d>> "/home/email.log" } else {print "check backup for " d}}' d="$ORACLE_SID"... (2 Replies)
Discussion started by: tapia
2 Replies

9. Shell Programming and Scripting

help with email to be triggered based on fatal error detection from batch run log file neded

Hi, I require need help in two aspects actually: 1) Fatal error that gets generated as %F% from a log file say ABClog.dat to trigger a mail. At present I manually grep the log file as <grep %F% ABClog.dat| cut-d "%" -f1>. The idea is to use this same logic to grep the log file which is... (1 Reply)
Discussion started by: zico1986
1 Replies

10. Shell Programming and Scripting

Send an email if "No such file or directory" in the shell script program log in EBS concur

Hi All, I have the below code(.sh) and need to send an email. #!/bin/bash cp /u02/xxc_incoming/TEST*.dat /u02/xxc_archive_incoming/AMER7764_ARPP_2/ cat /u02/xxc_incoming/TEST*.dat > /u02/xxc_incoming/XXC_TEST.dat rm /u02/xxc_incoming/TEST*.dat cd $XXC_TOP/bin sqlldr userid=apps/<pwd> ... (12 Replies)
Discussion started by: Mist123
12 Replies
Log::Report::Dispatcher::Log4perl(3pm)			User Contributed Perl Documentation		    Log::Report::Dispatcher::Log4perl(3pm)

NAME
Log::Report::Dispatcher::Log4perl - send messages to Log::Log4perl back-end INHERITANCE
Log::Report::Dispatcher::Log4perl is a Log::Report::Dispatcher SYNOPSIS
dispatcher Log::Log4perl => 'logger', accept => 'NOTICE-' , config => "$ENV{HOME}/.log.conf" , to_level => [ 'ALERT-' => $ERROR ]; # disable default dispatcher dispatcher close => 'logger'; # configuration inline, not in file: adapted from the Log4perl manpage my $name = 'logger'; my $outfile = '/tmp/a.log'; my $config = <<__CONFIG; log4perl.category.$name = INFO, Logfile log4perl.appender.Logfile = Log::Log4perl::Appender::File log4perl.appender.Logfile.filename = $outfn log4perl.appender.Logfile.layout = Log::Log4perl::Layout::PatternLayout log4perl.appender.Logfile.layout.ConversionPattern = %d %F{1} %L> %m __CONFIG dispatcher 'Log::Log4perl' => $name, config => $config; DESCRIPTION
This dispatchers produces output tot syslog, based on the "Sys::Log4perl" module (which will not be automatically installed for you). The REASON for a message often uses names which are quite similar to the log-levels used by Log::Dispatch. However: they have a different approach. The REASON of Log::Report limits the responsibility of the programmer to indicate the cause of the message: whether it was able to handle a certain situation. The Log::Dispatch levels are there for the user's of the program. However: the programmer does not known anything about the application (in the general case). This is cause of much of the trickery in Perl programs. The default translation table is list below. You can change the mapping using new(to_level). See example in SYNOPSIS. TRACE => $DEBUG ERROR => $ERROR ASSERT => $DEBUG FAULT => $ERROR INFO => $INFO ALERT => $FATAL NOTICE => $INFO FAILURE => $FATAL WARNING => $WARN PANIC => $FATAL MISTAKE => $WARN METHODS
Constructors $obj->close See "Constructors" in Log::Report::Dispatcher Log::Report::Dispatcher::Log4perl->new(TYPE, NAME, OPTIONS) The Log::Log4perl infrastructure has all information in a configuration file. In that file, you should find a category with the NAME. -Option --Defined in --Default accept Log::Report::Dispatcher depend on mode charset Log::Report::Dispatcher <undef> config <required> format_reason Log::Report::Dispatcher 'LOWERCASE' locale Log::Report::Dispatcher <system locale> mode Log::Report::Dispatcher 'NORMAL' to_level [] accept => REASONS charset => CHARSET config => FILENAME|SCALAR When a SCALAR reference is passed in, that must refer to a string which contains the configuration text. Otherwise, specify an existing FILENAME. format_reason => 'UPPERCASE'|'LOWERCASE'|'UCFIRST'|'IGNORE'|CODE locale => LOCALE mode => 'NORMAL'|'VERBOSE'|'ASSERT'|'DEBUG'|0..3 to_level => ARRAY-of-PAIRS See reasonToLevel(). Accessors $obj->appender Returns the Log::Log4perl::Logger object which is used for logging. $obj->isDisabled See "Accessors" in Log::Report::Dispatcher $obj->mode See "Accessors" in Log::Report::Dispatcher $obj->name See "Accessors" in Log::Report::Dispatcher $obj->needs See "Accessors" in Log::Report::Dispatcher $obj->type See "Accessors" in Log::Report::Dispatcher Logging $obj->collectLocation Log::Report::Dispatcher::Log4perl->collectLocation See "Logging" in Log::Report::Dispatcher $obj->collectStack([MAXDEPTH]) Log::Report::Dispatcher::Log4perl->collectStack([MAXDEPTH]) See "Logging" in Log::Report::Dispatcher $obj->log(HASH-of-OPTIONS, REASON, MESSAGE) See "Logging" in Log::Report::Dispatcher $obj->reasonToLevel(REASON) Returns a level which is understood by Log::Dispatch, based on a translation table. This can be changed with new(to_level). $obj->stackTraceLine(OPTIONS) Log::Report::Dispatcher::Log4perl->stackTraceLine(OPTIONS) See "Logging" in Log::Report::Dispatcher $obj->translate(HASH-of-OPTIONS, REASON, MESSAGE) See "Logging" in Log::Report::Dispatcher SEE ALSO
This module is part of Log-Report distribution version 0.94, built on August 23, 2011. Website: http://perl.overmeer.net/log-report/ LICENSE
Copyrights 2007-2011 by Mark Overmeer. For other contributors see ChangeLog. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html perl v5.14.2 2011-08-23 Log::Report::Dispatcher::Log4perl(3pm)
All times are GMT -4. The time now is 08:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy