Missing ssl_error.log


#1

I am just trying to watch my live ssl_error.log files, but I note that in a number of my websites it doesn’t seem to exist… The ssl_error.log.1 exists, as do the remaining gzipped logs.

Is this expected behavour when no errors are being reported?

Thanks in advance.


#2

Don’t worry about it.

I ran a test, which of course proves that the expected behaviour is for no ssl_error.log file to be generated until an error occurs.

Not sure why I didn’t think to test it before posting.


#3

Don’t worry, I often find a solution just after I’ve posted to a forum :slight_smile:


#4

Somewhat related to the original thread…

For those struggling keeping up with your apache logs, I made a couple of really simple bash scripts, and I enclose them below for anyone to use, if they so wish.

#!/bin/bash
LOGS_PATH=‘public/logs’
for d in /srv/*; do
if [[ -d $d ]]; then
for f in $d/$LOGS_PATH/*error.log; do
if [[ -f $f ]]; then
echo; echo “Logfile: $f”
tail -n40 $f
fi
done
fi
done
ZZ_ERROR_LOG=/var/log/apache2/zz-mass-hosting.error.log
if [[ -f $ZZ_ERROR_LOG ]]; then
echo; echo “Logfile: zz-mass-hosting.error.log”
tail -n40 $ZZ_ERROR_LOG
fi
ZZ_SSL_ERROR_LOG=/var/log/apache2/zz-mass-hosting.ssl_error.log
if [[ -f $ZZ_SSL_ERROR_LOG ]]; then
echo; echo “Logfile: zz-mass-hosting.ssl_error.log”
tail -n40 $ZZ_SSL_ERROR_LOG
fi

Apologies for the lack of indentations, can’t seem to get it to work.

To check access logs, just replace the words “error” with “access” and it should work, if on the same Symbiosis as me (which I think is Jessie, really not sure).

Edit: Sorry, no, I’m on Stretch.


#5

Hi @flippantorange

Thanks for sharing. I have more work to do than I thought. :wink:

I went with a slightly lazier version…

#!/bin/bash
for f in /srv/*/public/logs/*error.log; do
  if [[ -f $f ]]; then
    echo; echo "Logfile: $f"
    tail -n40 $f
  fi
done

(Formatted as ‘Preformatted text’, using spaces not tabs).


#6

Updated to include your lazy approach, plus addition of -a option for access logs (error logs is default), and tail’ing of /var/log/apache2 folder.

LOG_TYPE="error.log"
while getopts ":a" opt; do
 case $opt in
  a)
    LOG_TYPE="access.log"
    ;;
 esac
done
for f in /srv/*/public/logs/*$LOG_TYPE; do
 if [[ -f $f ]]; then
  echo; echo "Logfile: $f"
  tail -n40 $f
 fi
done
for f in /var/log/apache2/*$LOG_TYPE; do
 if [[ -f $f ]]; then
  echo; echo "Logfile: $f"
  tail -n40 $f
 fi
done