Empty log file when a container is started with the API

Bug #1181136 reported by Jean-Baptiste Lallement
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Triaged
Medium
Stéphane Graber

Bug Description

When a container is started with the python API the log file /var/log/lxc/NAME.log is empty. This is pretty annoying to debug pre-start hook issues for example.

ProblemType: Bug
DistroRelease: Ubuntu 13.10
Package: lxc 0.9.0-0ubuntu7
ProcVersionSignature: Ubuntu 3.9.0-1.5-generic 3.9.1
Uname: Linux 3.9.0-1-generic x86_64
ApportVersion: 2.10.1-0ubuntu1
Architecture: amd64
Date: Fri May 17 10:31:44 2013
MarkForUpload: True
SourcePackage: lxc
UpgradeStatus: Upgraded to saucy on 2012-01-31 (471 days ago)
lxcsyslog:

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for reporting this bug.

If you do

c.set_config_item("lxc.log.loglevel', '1')

before starting the container, does that help?

Also, if you cause an actual error during startup (i.e. specify a wrong rootfs location in the configuration), does an error then at least show up in the logfile? If not, then that should be fixed.

Changed in lxc (Ubuntu):
importance: Undecided → Medium
status: New → Incomplete
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

I tried multiple things:
c.set_config_item("lxc.loglevel", "1")
c.set_config_item("lxc.loglevel", "9")
c.set_config_item("lxc.loglevel", "debug")

And I always get:
lxc: invalid log priority 9

Without those, setting in the lxc config:
lxc.logfile = /tmp/foo
lxc.loglevel = debug

it creates an empty /tmp/foo file, but no content at all, even if it errored out.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 1181136] Re: Empty log file when a container is started with the API

Thanks, this is likely related to how the python bindings are
interpreting the second command. I woudl actually expect
c.set_config_item('lxc.loglevel', 'info') to work, but that
fails here too.

 status: confirmed
 assignee: stgraber
 priority: medium

Changed in lxc (Ubuntu):
status: Confirmed → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.