29

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.

14

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.

| improve this answer | |
  • 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 – sharkant Apr 28 '17 at 20:31
  • 1
    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 Apr 28 '17 at 20:34
  • Did this solve the problem for you? – Nick Rodriguez Apr 28 '17 at 22:32
  • 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? – sharkant Apr 29 '17 at 8:24
  • 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. – Nick Rodriguez Apr 29 '17 at 8:36
19

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.

| improve this answer | |
  • Useful writeup, though #2 log to file box no longer present, looks to have been moved to logging from before. – dez93_2000 Oct 13 '18 at 6:58
6

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".

| improve this answer | |
  • This should be the accepted answer. (I've never seen an accepted answer with negative votes before!) – Michael Scheper Feb 21 '18 at 20:11
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.

| improve this answer | |
  • Under what facility ? – ychaouche Jul 17 '19 at 15:51
  • @ychaouche sorry, I don't understand your question. What do you mean by "facility"? – Zoltán Jul 18 '19 at 14:58
  • Thank you, not one person could say where the location of the log file was – Joe Dec 13 '19 at 14:32
  • 1
    @ychaouche, the default facility seems to be user, and the default process/app-name is vlc. – JPvRiel Mar 23 at 9:49
3

You can set the location and verbosity level for the VLC log file like this:

  1. Select ToolsPreferences from the menu (or type CTRL + P)
  2. In the Show settings radio buttons at the bottom left of the preferences window, click 'All'
  3. Go to AdvancedLogging in the preferences tree

According to the manpage, this is what the different levels of verbosity mean:

  • 0 = silent

  • 1 = info/warning messages

  • 2 = debug

| improve this answer | |
0

If you try to stream something, and you get the "unable to open 'some device'"-error, then you need to install vlc-plugin-access-extra:

sudo apt-get install vlc-plugin-access-extra
| improve this answer | |
0

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...

| improve this answer | |
0

You do not have to enable logging just to see one-off error messages.

  1. Open the Messages window (ToolsMessages, also available via Ctrl-M).
  2. At the bottom of the window, enable verbose output (often, the default level will be enough (errors).
  3. Open your source again and look for anything that stands out in the log window.
  4. If you cannot find anything obvious, try setting it to "warnings", then open your source again.

You may also try setting it to debug if you feel bold, but most of the times this will give you way more information than what you need.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.