Sponsored Content
Top Forums Shell Programming and Scripting Complete Screen Output to Log File Post 302416307 by enjoy on Monday 26th of April 2010 05:08:45 AM
Old 04-26-2010
Complete Screen Output to Log File

Hi,

I would need to log the whole screen ouput to a log file.
All Inputs from the Agent, all echo´s and DBMS Outputs from the PL/SQL.
Basicly everything what I can see during the run on the screen.

I tried it already with

Code:
#exec 2>$BASELOG/RUN.log
#exec 1>$BASELOG/RUN.log
#exec > $BASELOG/RUN.log 2>&1 | tee $BASELOG/RUN.log

But nowone of this command is doing what I need.

The issue is that the command should be in the *.ksh
and not startet with the re-direct command from the c.line like:

Code:
Job.sh > Job.log 2>&1

I am thankfull for any help.

I am working with ksh

Last edited by Franklin52; 04-26-2010 at 06:15 AM.. Reason: Please use code tags!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

perl - print to a log file and screen

as the title suggests, i need to print a user message to a log file and the screen using perl. in unix i set up a function using 'tee' like so function Display_Message { echo "$*" | tee -ai $LOGFILE } the following command then obviously displays to the screen and prints to a log... (6 Replies)
Discussion started by: mjays
6 Replies

2. Shell Programming and Scripting

Putting screen output in a log file

I want to output screen messages to a logfile when executing an automated script. I have tried the script and command to do this but with no luck. Thanks, Nicole (5 Replies)
Discussion started by: nsutti
5 Replies

3. UNIX for Dummies Questions & Answers

To output complete record with JOIN

Hi I have 2 files file1 12312341231612634 34534368463786347 23472364287687263 23472357841007237 file2 12123561235176351*dhfsdhfh*2347623462*sdfjshehweu*123651235*sdgfsgfsy*23237346* 23472357841007237*defsjdf*12378234*hsdhfsdhgfsh*12837238947*dsjshgdfs*2348972348*... (1 Reply)
Discussion started by: unxusr123
1 Replies

4. UNIX Desktop Questions & Answers

Output terminal sessions to screen and log file

I would like to use a terminal session to ssh to switches and routers. I need to capture data while logged into switches to a file I can email for troubleshooting. I use termial to log into Cisco switch, run the sh tech command, and then sent the output to cisco. Is there a way to run a... (4 Replies)
Discussion started by: tdelliott
4 Replies

5. UNIX for Dummies Questions & Answers

how to print script output to screen and file

Hi all, I have a script that bulk loads thousands of lines of data. I need to log the output during the execution of the script. I know I can redirect (">") the output to a file; however, I want the output going to both the screen and the log file. I thought I could use pipe to pipe the... (10 Replies)
Discussion started by: orahi001
10 Replies

6. Shell Programming and Scripting

Redirect the output in a file and on screen

I am trying to get following result from the scipt I have. First time it generates the o/p in correct format. However if I run it again it appends to the existing file. I would like to see o/p on screen as well as save it in file. Everytime it should create new file. ## I/P file 0174 0175... (3 Replies)
Discussion started by: dynamax
3 Replies

7. Shell Programming and Scripting

Ps complete output

HI ALl I am creating a script where i can print ps output to find out most CPU utilised process.but in ps -ef we can get arg list only up to 80 character. ps -ef | more UID PID PPID C STIME TTY TIME CMD root 0 0 0 Feb 20 ? 0:40 sched root ... (3 Replies)
Discussion started by: devesh123
3 Replies

8. Shell Programming and Scripting

Need output of script on screen and file with correct return status of the called script.

Hi, I am trying to capture logs of the script in the file as well as on the screen. I have used exec and tee command for this. While using exec command I am getting the correct output in the file but, script output is not getting displayed on the screen as it get executed. Below is my sample... (14 Replies)
Discussion started by: Prathmesh
14 Replies

9. Programming

No output screen when run from file manager

So I have ported a C++ program from windows to linux and when I run it from terminal all is well. However when executed from file manager there is no screen output. The program runs and does what it should, just the problem of not knowing if there are errors or if its even complete. Is there a... (12 Replies)
Discussion started by: pinbot
12 Replies

10. UNIX for Beginners Questions & Answers

Screen output to a file

Hi All, I am trying to out of shell script when i run it like sh /mypath/abc.sh ....a screen log should be generated whenever i input the values, when above the script prompt for values Regards Amarendra (3 Replies)
Discussion started by: amar1208
3 Replies
Log::Dispatch::Configurator::Any(3pm)			User Contributed Perl Documentation		     Log::Dispatch::Configurator::Any(3pm)

NAME
Log::Dispatch::Configurator::Any - Configurator implementation with Config::Any VERSION
version 1.110690 SYNOPSIS
In the traditional Log::Dispatch::Config way: use Log::Dispatch::Config; # loads Log::Dispatch use Log::Dispatch::Configurator::Any; my $config = Log::Dispatch::Configurator::Any->new('log.yml'); Log::Dispatch::Config->configure($config); # nearby piece of code my $log = Log::Dispatch::Config->instance; $log->alert('Hello, world!'); Alternatively, without a config file on disk: use Log::Dispatch::Config; # loads Log::Dispatch use Log::Dispatch::Configurator::Any; my $confhash = { dispatchers => ['screen]', screen = { class => 'Log::Dispatch::Screen', min_level => 'debug', }, }; my $config = Log::Dispatch::Configurator::Any->new($confhash); Log::Dispatch::Config->configure($config); # nearby piece of code my $log = Log::Dispatch::Config->instance; $log->alert('Hello, world!'); DESCRIPTION
Log::Dispatch::Config is a wrapper for Log::Dispatch and provides a way to configure Log::Dispatch objects with configuration files. Somewhat like a lite version of log4j and Log::Log4perl it allows multiple log destinations. The standard configuration file format for Log::Dispatch::Config is AppConfig. This module plugs in to Log::Dispatch::Config and allows the use of other file formats, in fact any format supported by the Config::Any module. As a bonus you can also pass in a configuration data structure instead of a file name. PURPOSE
Use this module in combination with Log::Dispatch::Config to allow many formats of configuration file to be loaded, via the Config::Any module. USAGE
Follow the examples in the "SYNOPSIS". If you are using an external configuration file, be aware that you are required to use a filename extension (e.g. ".yml" for YAML). Below are a couple of tips and tricks you may find useful. Fall-back default config Being able to use a configuration data structre instead of a file on disk is handy when you want to provide application defaults which the user then replaces with their own settings. For example you could have the following: my $defaults = { dispatchers => ['screen'], screen => { class => 'Log::Dispatch::Screen', min_level => 'debug', }, }; my $config_file = '/etc/myapp_logging.conf'; my $config = $ENV{MYAPP_LOGGING_CONFIG} || $ARGV[0] || ( -e $config_file ? $config_file : $defaults); Log::Dispatch::Config->configure_and_watch( Log::Dispatch::Configurator::Any->new($config) ); my $dispatcher = Log::Dispatch::Config->instance; With the above code, your application will check for a filename in an environment variable, then a filename as a command line argument, then check for a file on disk, and finally use its built-in defaults. Dealing with a "dispatchers" list Log::Dispatch::Config requires that a global setting "dispatchers" have a list value (i.e. your list of dispatchers). A few config file formats do not support list values at all, or list values at the global level (two examples being Config::Tiny and Config::General). This module allows you to have a small grace when there is only one dispatcher in use. Write the configuration file normally, and the single-item "dispatchers" value will automatically be promoted to a list. In other words: # myapp.ini dispatchers = screen # this becomes a config of: $config = { dispatchers => 'screen', ... }; # so this module promotes it to: $config = { dispatchers => ['screen'], ... }; If you want more than one dispatcher, you then need to use a config file format which supports these lists natively, I'm afraid. A good suggestion might be YAML. THANKS
My thanks to "miyagawa" for writing Log::Dispatch::Config, from where I also took some tests. Also thanks to Florian Merges for his YAML Configurator, which was a useful example and saved me much time. AUTHOR
Oliver Gorwits <oliver@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by University of Oxford. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2011-03-10 Log::Dispatch::Configurator::Any(3pm)
All times are GMT -4. The time now is 03:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy