Questions tagged [stderr]

40 questions
241
votes
5 answers

How to see stdout of ansible commands?

How do I see stdout for ansible-playbook commands? -v only shows ansible output, not the individual commands. It would be great if I could figure out how to do this immediately, so if something fails or hangs I can see why. e.g. - name: print to…
QuinnBaetz
  • 2,519
  • 2
  • 12
  • 3
152
votes
11 answers

bash: print stderr in red color

Is there a way to make bash display stderr messages in red color?
kolypto
  • 10,738
  • 12
  • 51
  • 66
26
votes
4 answers

How to pipe stderr without piping stdout

How do I pipe the standard error stream without piping the standard out stream? I know this command works, but it also writes the standard out. Command 2>&1 | tee -a $LOG How do I get just the standard error? Note: What I want out of this is to…
C. Ross
  • 2,995
  • 8
  • 32
  • 36
20
votes
2 answers

tar: kill the error message: 'tar: Removing leading `/' from member names'

I run this from a cronjob: tar -czvf /var/backups/svn.tgz /var/svn/* That generates this on stderr: tar: Removing leading `/' from member names I would like to avoid this because it is not a real error (for me!). I want on stderr only things that…
Dan
  • 359
  • 1
  • 4
  • 16
15
votes
4 answers

How can I capture output from LFTP? (Output not written to STDOUT or STDERR?)

I would like get access to progress information from lftp. Currently, I'm using curl like so: curl http://example.com/file -o file -L 2> download.log This writes curl's progress information to the download.log file, which I can tail to get…
jondahl
  • 153
  • 1
  • 1
  • 4
10
votes
4 answers

Is there anyway to get msiexec to echo to stdout instead of logging to a file

As part of a continuous delivery pipeline I'd like to install an msi on a given machine. msiexec plus psexec does this perfectly, but it seems that msiexec can only log to a file and I need it to log to stdout/stderr. Right now, to get the output…
mrmrcoleman
  • 101
  • 1
  • 4
9
votes
2 answers

Completely silent robocopy

I'm trying to robocopy some files silently. Right now, I have robocopy putting everything into a log file, which is fine, but after it finished, Log File: C:\ is printed. My command looks like this: robocopy source destination…
CoV
  • 91
  • 1
  • 1
  • 3
7
votes
4 answers

Should a foreground program invoked by a daemon split logging between stderr and stdout based on severity levels?

Usually log messages are written to stderr. I'm wondering if it is a good idea/practice to split log messages so that errors and warnings go to stderr while debug/informational/notice messages go to stdout instead? Or is this irrelevant given that…
Rio
  • 325
  • 2
  • 10
7
votes
2 answers

Start Sinatra app in the background with stdout and stderr redirected (append) to a file

I have a Sinatra app which I run on my local machine using ruby app.rb. While deploying it on a remote machine via ssh, how do I run it in background and redirect stdout and stderr to a log file? On a restart, I want to preserve the previous logs so…
letronje
  • 429
  • 1
  • 6
  • 16
4
votes
1 answer

nginx logs php-fpm's stderr output cut off at seemingly random positions

Ever since I started using a PHP library that produces a long call chain it's been increasingly difficult to debug issues caused by it because my error logs end up containing output like this: (some values have been blanked out using *) 2017/08/23…
SeinopSys
  • 512
  • 2
  • 6
  • 19
4
votes
1 answer

On Apache2/mod_perl2, stderr output doesn't go to logfile nominated by ErrorLog

I like to maintain separate Apache2 logfiles for each of my named virtual hosts, like this: ServerName myhost.example.com ErrorLog /var/log/apache2/myhost-error.log The nominated file correctly gathers…
3
votes
2 answers

logging/capturing STDERR/STDOUT on Amazon EC2

I'm looking for a solution that would allow me to automatically capture the STDOUT/STDERR of a process running on Amazon EC2, and send it (remotely) to another server. Sound simple, except: I will be using spot-instances, which means I don't…
3
votes
1 answer

SNMP error reporting to stdout

Why does net-snmp after "No Such Object available on this agent at this OID" errors exit with 0 and print the error message to STDOUT while other errors are printed to STDERR and have an exit status 1? Compare: $ /usr/bin/snmpget -Oqv -v2c -cpublic…
user3040975
  • 131
  • 2
3
votes
2 answers

Null bytes in a file created by 2> rotated with logrotate?

I'm using the script utility to record terminal sessions, and using logrotate (with copytruncate, script ignores HUP and keeps writing to the rotated file otherwise) to periodically upload chunks of what's happened so far to another server. This…
Jeremy Wadhams
  • 867
  • 2
  • 9
  • 19
3
votes
1 answer

Write stderror to a file using PowerShell

How do I capture error messages from a PowerShell-launched command in a text file? I searched the Internet for a while and found that supposedly, I should be able to do something like ""C:\UniServer\usr\local\mysql\bin\mysqldump.exe" -h 192.0.2.0…
Zian Choy
  • 281
  • 5
  • 18
1
2 3