Sponsored Content
Top Forums Programming writing to multiple syslog facilities Post 87573 by dmirza on Tuesday 25th of October 2005 05:01:08 PM
Old 10-25-2005
writing to multiple syslog facilities

is there a way to allow one application to simultaneously write to multiple syslog facilities?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Multiple processes writing on the same file simultaneously

Hi All, I have encountered a problem,please help me. I have a script in which multiple processes are writing on to the same file . How should I stop this , I mean lock mechanism can be implemented or we can write the at different files and then concatenate the files. What would be a better... (1 Reply)
Discussion started by: Sayantan
1 Replies

2. UNIX for Dummies Questions & Answers

A comparison of the multi-user facilities in Unix and Microsoft Windows.

hi guys just give me some information about multi user facilities that unix offer in cmparison to windows. Thanx (2 Replies)
Discussion started by: nadman123
2 Replies

3. Shell Programming and Scripting

Writing out 2nd column into one file from multiple files

I have several files that are being generated every 20 minutes. Each file contains 2 columns. The 1st column is Text, 2nd column is Data. I would like to generate one single file from all these files as follows: One instance of 1st column Text, followed by 2nd column Data separated by... (5 Replies)
Discussion started by: subhap
5 Replies

4. UNIX for Dummies Questions & Answers

Reading and writing data to and from multiple files

Hi, I have several text files. One main file contains the detail data, other have some information to extract data from the main file, and some are empty files. Examples are shown below: The main file look like: MainFile.txt >Header1 data1...data1... >Header2 data2...data2... ... ...... (2 Replies)
Discussion started by: Fahmida
2 Replies

5. UNIX for Dummies Questions & Answers

Writing a for loop that processes multiple input files

I would like to write a for loop that does the following: I have a file called X.txt and other files called 1.txt,2.txt, .....,1000.txt. I want to substitute the 6th column of the file X.txt with 1.txt and store the output as X.1. Then I want to do the same with X.txt and 2.txt and store the... (1 Reply)
Discussion started by: evelibertine
1 Replies

6. Shell Programming and Scripting

Writing a Perl Script that processes multiple files

I want to write a Perl script that manipulates multiple files. In the directory, I have files 250.*chr$.ped where * is from 1 to 1000 and $ is from 1-22 for a total of 22 x 10,000 = 22,000 files. I want to write a script that only manipulates files 250.1chr*.ped where * is from 1 to 22.... (10 Replies)
Discussion started by: evelibertine
10 Replies

7. Shell Programming and Scripting

Writing an snmp script to grab multiple oids at once

is it possible to grab the following oids with one invocation of the snmp command, instead of having to run separate commands: snmpwalk -v2c -c commst hostname hrStorageUsed snmpwalk -v2c -c commst hostname hrStorageDescr snmpwalk -v2c -c commst hostname hrStorageAllocationUnits ... (2 Replies)
Discussion started by: SkySmart
2 Replies

8. Post Here to Contact Site Administrators and Moderators

Usage of search facilities

The search function, which has recently been revised, has facilities to search at the post level and at the project level. Do we know if searching at the project level is actually used? Do we keep measures on what links users use to search for posts / information? Perhaps we can make the search... (7 Replies)
Discussion started by: figaro
7 Replies

9. UNIX for Dummies Questions & Answers

Writing a for loop to manipulate multiple files

Hi, I have 1000 text files in a folder that are labeled data1.txt all the way to data1000.txt. I want to write a small script that manipulates the text files in this way: (1) cut the 2nd and 9th columns of the text files (2) sort by the numerical value in the 9th column (3) then save the rows... (3 Replies)
Discussion started by: evelibertine
3 Replies

10. Open Source

Help with writing Shell Script to automate process using multiple commands

Hello! Need help to write a Linux script that can be run from windows using command/Cygwin/any other way. I am new to scripting, actually i am trying to automate server health check like free disk space, memory along with few services status, if any services is not running then start services ,... (7 Replies)
Discussion started by: Sayed Ibrahim
7 Replies
explain_output(3)					     Library Functions Manual						 explain_output(3)

NAME
explain_output - output error messages SYNOPSIS
#include <libexplain/output.h> DESCRIPTION
These functions may be used to write error messages. explain_output_message void explain_output_message(const char *text); The explain_output_message function is used to print text. It is printed via the registered output class, see explain_output_register(3) for how. text The text of the message to be printed. It has not been wrapped (yet). explain_output_error void explain_output_error(const char *fmt, ...); The explain_output_error function is used to print a formatted error message. The printing is done via the explain_output_message(3) func- tion. fmt The format text of the message to be printed. See printf(3) for more information. explain_output_error_and_die void explain_output_error_and_die(const char *fmt, ...); The explain_output_error_and_die function is used to print text, and then terminate immediately. The printing is done via the explain_out- put_message(3) function, process termination is via the explain_output_exit_failure(3) function. fmt The format text of the message to be printed. See printf(3) for more information. explain_output_warning void explain_output_warning(const char *fmt, ...); The explain_output_warning function is used to print a formatted error message, including the word "warning". The printing is done via the explain_output_message(3) function. fmt The format text of the message to be printed. See printf(3) for more information. explain_output_exit void explain_output_exit(int status); The explain_output_exit function is used to terminate execution. It is executed via the registered output class, explain_output_regis- ter(3) for how. status The exist status requested. explain_output_exit_failure void explain_output_exit_failure(void); The explain_output_exit_failure function is used to terminate execution, with exit status EXIT_FAILURE. It is executed via the registered output class, see explain_output_register(3) for how. explain_option_hanging_indent_set void explain_option_hanging_indent_set(int columns); The explain_option_hanging_indent_set function is used to cause the output wrapping to use hanging indents. By default no hanging indent is used, but this can sometimes obfuscate the end of one error message and the beginning of another. A hanging indent results in continua- tion lines starting with white space, similar to RFC822 headers. This can be set using the "hanging-indent=n" string in the EXPLAIN_OPTIONS environment variable. See explain(3) for more information. Using this function will override any environment variable setting. columns The number of columns of hanging indent to be used. A value of 0 means no hanging indent (all lines flush with left margin). A common value to use is 4: it doesn't consume too much of each line, and it is a clear indent. OUTPUT REDIRECTION
It is possible to change how and where libexplain sends its output, and even how it calls the exit(2) function. This functionality is used by the explain_*_or_die and explain_*_on_error functions. By default, libexplain will wrap and print error messages on stderr, and call the exit(2) system call to terminate execution. Clients of the libexplain library may choose to use some message handling facilities provided by libexplain, or they may choose to imple- ment their own. syslog To cause all output to be sent to syslog, use explain_output_register(explain_output_syslog_new()); This is useful for servers and daemons. stderr and syslog The "tee" output class can be used to duplicate output. To cause all output to be sent to both stderr and syslog, use explain_output_register ( explain_output_tee_new ( explain_output_stderr_new(), explain_output_syslog_new() ) ); If you need more than two, use several instances of "tee", cascaded. stderr and a file To cause all output to be sent to both stderr and a regular file, use explain_output_register ( explain_output_tee_new ( explain_output_stderr_new(), explain_output_file_new(filename, 0) ) ); See the <libexplain/output.h> file for extensive documentation. explain_output_new explain_output_t *explain_output_new(const explain_output_vtable_t *vtable); The explain_output_new function may be used to create a new dynamically allocated instance of explain_output_t. vtable The struct containing the pointers to the methods of the derived class. returns NULL on error (i.e. malloc failed), or a pointer to a new dynamically allocated instance of the class. explain_output_stderr_new explain_output_t *explain_output_stderr_new(void); The explain_output_stderr_new function may be used to create a new dynamically allocated instance of an explain_output_t class that writes to stderr, and exits via exit(2); This is the default output handler. returns NULL on error (i.e. malloc failed), or a pointer to a new dynamically allocated instance of the stderr class. explain_output_syslog_new explain_output_t *explain_output_syslog_new(void); The explain_output_syslog_new function may be used to create a new dynamically allocated instance of an explain_output_t class that writes to syslog, and exits via exit(2); The following values are used: option = 0 facility = LOG_USER level = LOG_ERR See syslog(3) for more information. returns NULL on error (i.e. malloc(3) failed), or a pointer to a new dynamically allocated instance of the syslog class. explain_output_syslog_new1 explain_output_t *explain_output_syslog_new1(int level); The explain_output_syslog_new1 function may be used to create a new dynamically allocated instance of an explain_output_t class that writes to syslog, and exits via exit(2); The following values are used: option = 0 facility = LOG_USER See syslog(3) for more information. level The syslog level to be used, see syslog(3) for a definition. returns NULL on error (i.e. malloc(3) failed), or a pointer to a new dynamically allocated instance of the syslog class. explain_output_syslog_new3 explain_output_t *explain_output_syslog_new3(int option, int facility, int level); The explain_output_syslog_new3 function may be used to create a new dynamically allocated instance of an explain_output_t class that writes to syslog, and exits via exit(2); If you want different facilities or levels, create multiple instances. option The syslog option to be used, see syslog(3) for a definition. facility The syslog facility to be used, see syslog(3) for a definition. level The syslog level to be used, see syslog(3) for a definition. returns NULL on error (i.e. malloc(3) failed), or a pointer to a new dynamically allocated instance of the syslog class. explain_output_file_new explain_output_t *explain_output_file_new(const char *filename, int append); The explain_output_file_new function may be used to create a new dynamically allocated instance of an explain_output_t class that writes to a file, and exits via exit(2). filename The file to be opened and written to. append true (non-zero) if messages are to be appended to the file, false (zero) if the file is to be replaced with new contents. returns NULL on error (i.e. malloc(3) or open(2) failed), or a pointer to a new dynamically allocated instance of the syslog class. explain_output_tee_new explain_output_t *explain_output_tee_new(explain_output_t *first, explain_output_t *second); The explain_output_tee_new function may be used to create a new dynamically allocated instance of an explain_output_t class that writes to two other output classes. first The first output class to write to. second The second output class to write to. returns NULL on error (i.e. malloc(3) failed), or a pointer to a new dynamically allocated instance of the syslog class. The output subsystem will "own" the first and second objects after this call. You may not make any reference to these pointers ever again. The output subsystem will destroy these objects and free the memory when it feels like it. explain_output_register void explain_output_register(explain_output_t *op); The explain_output_register function is used to change libexplain's default output handling facilities with something else. The NULL pointer restores libexplain's default processing. If no output class is registered, the default is to wrap and print to stderr, and to exit via the exit(2) system call. op Pointer to the explain_output_t instance to be operated on. The output subsystem will "own" the pointer after this call. You may not make any reference to this pointer ever again. The output sub- system will destroy the object and free the memory when it feels like it. COPYRIGHT
libexplain version 0.52 Copyright (C) 2010 Peter Miller AUTHOR
Written by Peter Miller <pmiller@opensource.org.au> explain_output(3)
All times are GMT -4. The time now is 03:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy