Logs

Working with DMESG

dmesg - print or control the kernel ring buffer

rex@mintAspire-V5 ~ $ less /var/log/dmesg rex@mintAspire-V5 ~ $ ls /var/log/dmesg* /var/log/dmesg /var/log/dmesg.1.gz /var/log/dmesg.3.gz /var/log/dmesg.0 /var/log/dmesg.2.gz /var/log/dmesg.4.gz rex@mintAspire-V5 ~ $

After executing command less /var/log/dmesg

Type below /error and you can locate specific error on the logs. Below example.

[ 1.771867] usb 3-1.4: string descriptor 0 read error: -22

[ 1.771877] usb 3-1.4: New USB device found, idVendor=0489, idProduct=e04e

[ 1.771880] usb 3-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber

Working with /var/log/message

rex@mintAspire-V5 ~ $ less /var/log/messages rex@mintAspire-V5 ~ # more -f /var/log/messages

# cat /var/log/messages

# tail -f /var/log/messages

# grep -i error /var/log/messages

Almost all logfiles are located under /var/log directory and its sub-directories on Linux. You can change to this directory using the cd command. You need be the root user to view or access log files on Linux or Unix like operating systems. You can use the following commands to see the log files:

    1. less command

    2. more command

    3. cat command

    4. grep command

    5. tail command

    6. zcat command

    7. zgrep command

    8. zmore command

Running the Logs on the Powershell.

Quick screen shot of PowerShell type -wait (type is an alias for get-content)

type -wait c:\test\app\log\realtimeshot-000T.txt

Viewing Logs in Real Time:

If your log file name is /var/log/messages, enter:

      1. tail -f /var/log/messages :: Running 50 lines :: tail -50 -f /var/log/messages :: tail -f n 50 /var...

If your log file name is /var/log/lighttpd/access.log, enter:

      1. tail -f /var/log/lighttpd/access.log

      2. If your php log file name is /var/log/lighttpd/scripts.log, enter

        1. tail -f /var/log/lighttpd/scripts.log