Where is the VLC logfile for errors?

145,193

Solution 1

You can set the VLC log file location directly in the client by going into the options Tools -> Preferences -> Select "ALL" -> Advanced -> Logging. You can also set the verbosity 0: silent, 1: error/info, 2: warning, 3: debug depending on the level of information you would like in the log file. Then restart the VLC client for the changes to take effect.

Solution 2

Thanks to Pananoid Panda and Kluegerama for supplying the detail, but I think this answer needs to be more concise. For those of you looking to enable logging in VLC the following steps are confirmed to work on Mac, Linux and Windows.

On a PC go to Tools -> Preferences -> Press "Show All" button (bottom left of pop-up window) -> Advanced -> Advanced settings -> Logger. On a Mac preferences is under the VLC menu, the rest is the same as for PC.

  1. Tick the box to 'Log to file'. Specify log file name under where it says 'Log filename' and click the browse button to set a location for the log file. You must browse to where you want the log file to be, then click Save (Select on a Mac).

  2. Choose Text for the Log format.

  3. Set verbosity to Debug (option 2 on older versions) - other options are Info, Warning (both option 1 on older versions) and Error. The Default option is equivalent to 0 on older versions.

  4. Click the Save button and exit VLC.

  5. Restart VLC.

When you next start VLC, it will be logging all activity to the file specified.

Solution 3

To add to what Paranoid Panda said, you must also enable logging:

Select the "Interface" section in Preferences (after following the same directions for showing all settings), and check the appropriate for "Log to file" and/or "Log to syslog".

Solution 4

Before you set VLC to log to file as @AnotherLongUsername described, VLC will be logging to /var/log/syslog. This file is shared among many different applications, so you will have to search for "vlc" in that file to find VLC's messages.

Solution 5

TL;DR: Try journalctl -r _COMM=vlc for the default modern systemd based Linux distros (Ubuntu 15.04+), which includes jounrald as a common logging sink for processes logging via stdout, including VLC.

Many answers above are useful and informative, @Zoltán had an answer that works for VLC installed via snap (sudo snap install vlc):

VLC will be logging to /var/log/syslog

However, the better more modern way would be to use journalctl filtered to the vlc command, e.g. last 10 lines:

journalctl -r _COMM=vlc --lines 10 --no-pager

The following old way searching syslog works well enough, given rsyslogd reads journald and logs to /var/log/syslog by default:

grep vlc /var/log/syslog | tail

The above two options worked by default (for VLC snap 3.0.8 and Ubuntu 18.04.4 LTS) given the vlc process logs to stdout and I assume journald captures stdout. So both of the following, as per default, can remain unchecked:

  • Advanced -> Logger -> Log to file
  • Advanced -> syslog -> System log (syslog)

However, if you execute vlc directly from a terminal instead of gnome (or alternate) desktop launcher, then stdout and stderr IO streams would go to the terminal console instead of journald. In such a case, enabling either of the two explicit logging options might be appropriate.

Logging to a file can be tricky if the app is installed as a snap, since snaps have a stricter security model and might block creating a log file in arbitrary directories.

If a dedicated log file is desired, either log to a location the snap is allowed to write to (see snap connections vlc, where I noticed locations such as your home dir can be written to). Writing directly to somewhere in /var/log probably won't be allowed.

By default (in Ubuntu 18.04), journald doesn't persist events across reboots, but syslog does. One can explicitly enable journald events to persist if so desired.

VLC logging to file directly doesn't seem to put timestamps into the direct log file while journald and syslog include timestamps for when the event was generated.

Until the Linux community is fully ready to adopt journald (with persistence) instead of syslog, they coexist, so the legacy *nix way of handling this would be to configure rsyslog to redirect VLC logs into a separate log location. E.g. create the dir with appropriate permissions:

sudo mkdir /var/log/vlc
sudo chown syslog:adm /var/log/vlc
sudo chmod ug+rwX,o-rwx /var/log/vlc/

Add a config file to rsyslog, e.g. at /etc/rsyslog.d/30-vlc.conf:

# filter out and move various VLC snap messages to it's own log file
if ($programname == 'vlc' or $programname == 'vlc_vlc.desktop') then
{
  action
  ( name="cntlm_log_file"
    type="omfile"
    file="/var/log/vlc/vlc.log"
    fileCreateMode="0640"
    fileOwner="syslog"
    fileGroup="adm"
  )
  # don't log events to the system's default syslog file
  stop
}

Restart the service: sudo systemctl restart rsyslog

Also be sure to setup logrotate as well, e.g. to rotate weekly and keep 12 weeks, create a file /etc/logrotate.d/vlc as follows:

/var/log/vlc/*.log
{
    rotate 12
    weekly
    missingok
    notifempty
    compress
    delaycompress
    sharedscripts
    postrotate
        invoke-rc.d rsyslog rotate >/dev/null 2>&1 || true
    endscript
}

Happy logging...

Share:
145,193

Related videos on Youtube

sharkant
Author by

sharkant

i like White chocolate with almonds from ALDI, vangelis, hong kong Pop Music from the 80s and early 90s, star trek the classic series, blue led lights at night. I dislike social pressure, being not as intelligent and good looking as i wished to be, the headache and Tinnitus i suffer from 24/7. I am a White male from Germany, suffering from agoraphobia, bound to a Limit of locomotion within a radius of about 1 km , but it depends on specific environmental Features. i am a single, i have a few friends, but i am alone most of the time.

Updated on September 18, 2022

Comments

  • sharkant
    sharkant almost 2 years

    I tried to open a blu ray with VLC, but I got this error message:

    VLC is unable to open the MRL 'bluray:///dev/sr0'. Check the log for details.

    For further information I have to read a log from VLC, but I can not find any log, I only found with which vlc where vlc is located, namely

    /usr/bin/vlc

    I went there, but found no log file.

  • sharkant
    sharkant about 7 years
    thx, this narrows my search, however there are many log files in /var/log , do not know how to find the one which belongs to vlc
  • Nick Rodriguez
    Nick Rodriguez about 7 years
    Ok, it might actually be an option you set in the program, Try going to VLC -> Tools -> Preferences -> Select "ALL" -> Advanced -> Logging, as described in the link below: forum.videolan.org/viewtopic.php?t=101543
  • Nick Rodriguez
    Nick Rodriguez about 7 years
    Did this solve the problem for you?
  • sharkant
    sharkant about 7 years
    when I follow the path you ve given, than there is indeed a field called "logfilename" but it is blank. Does this mean I have to choose myself a logfilename and only once I ve created it the error messages will be displayed there?
  • Nick Rodriguez
    Nick Rodriguez about 7 years
    Yes, you have to choose the log file you want to use. Then I believe you will have to restart the player for the changes to take effect. Also, make sure the verbosity is set to either 1 or 2 depending on the detail of error logging you would like.
  • Michael Scheper
    Michael Scheper over 6 years
    This should be the accepted answer. (I've never seen an accepted answer with negative votes before!)
  • dez93_2000
    dez93_2000 over 5 years
    Useful writeup, though #2 log to file box no longer present, looks to have been moved to logging from before.
  • ychaouche
    ychaouche almost 5 years
    Under what facility ?
  • Zoltán
    Zoltán almost 5 years
    @ychaouche sorry, I don't understand your question. What do you mean by "facility"?
  • Joe
    Joe over 4 years
    Thank you, not one person could say where the location of the log file was
  • JPvRiel
    JPvRiel over 4 years
    @ychaouche, the default facility seems to be user, and the default process/app-name is vlc.