You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
564 B
26 lines
564 B
2 years ago
|
# LOGGER
|
||
|
|
||
|
Enrich command output for logging purpose.
|
||
|
This works by sending stdout and stderr to named pipes.
|
||
|
The content is read from the pipes and enriched before writing to a file.
|
||
|
There are three enrichment examples in logger.sh:
|
||
|
|
||
|
- plain text
|
||
|
- json format
|
||
|
- systemd journal
|
||
|
|
||
|
## Usage
|
||
|
|
||
|
Add the commands you want to run in the ./writer.sh file.
|
||
|
Start the process via ./controller.sh.
|
||
|
|
||
|
``` bash
|
||
|
./controller.sh
|
||
|
```
|
||
|
|
||
|
The last command in ./writer.sh ensures that the named pipes get closed and removed in a save way!
|
||
|
|
||
|
``` bash
|
||
|
echo "quit" >$pipe 2>$err_pipe
|
||
|
```
|