Glance logging configuration

Asked by steve chu

I added the following lines in glance.conf file.

## logging
--log_dir = /var/log/glance
--log_file = glance.log
--log_date_format = %Y-%m-%d %H:%M:%S
--log-config = /usr/etc/logging.cnf

I restarted both glance-api and glance-registry servers.

The log file can not be created!

Please help!

Question information

Language:
English Edit question
Status:
Solved
For:
Glance Edit question
Assignee:
No assignee Edit question
Solved by:
Jay Pipes
Solved:
Last query:
Last reply:
Revision history for this message
Jay Pipes (jaypipes) said :
#1

Hi Steve! Sorry, I was not being notified about questions for Glance! That has now been fixed, and I responded to your doc question about this. Please do refer to that answer here: http://docs.openstack.org/cactus/openstack-compute/admin/content/configuring-logging-for-glance.html.

Thanks!
jay

Revision history for this message
steve chu (steve-chu) said :
#2

Hi Jay, your answer was exactly what I had asked in my queston. I followed the instruction in the doc you pointed me to, but it did not work.

Steve Chu

Revision history for this message
Jay Pipes (jaypipes) said :
#3

Please paste your glance.conf in its entirety. Thanks!
-jay

Revision history for this message
steve chu (steve-chu) said :
#4

[DEFAULT]
# Show more verbose log output (sets INFO log level output)
verbose = True

# Show debugging output in logs (sets DEBUG log level output)
# debug = False
debug = True

[app:glance-api]
paste.app_factory = glance.server:app_factory

# Which backend store should Glance use by default is not specified
# in a request to add a new image to Glance? Default: 'file'
# Available choices are 'file', 'swift', and 's3'
default_store = file

# Address to bind the API server
# bind_host = 0.0.0.0
bind_host = 10.3.40.22

# Port the bind the API server to
bind_port = 9292

# Address to find the registry server
# registry_host = 0.0.0.0
registry_host = 10.3.40.22

# Port the registry server is listening on
registry_port = 9191

# ============ Filesystem Store Options ========================

# Directory that the Filesystem backend store
# writes image data to
filesystem_store_datadir=/var/lib/glance/images/

# ============ Swift Store Options =============================

# Address where the Swift authentication service lives
swift_store_auth_address = 127.0.0.1:8080/v1.0/

# User to authenticate against the Swift authentication service
swift_store_user = jdoe

# Auth key for the user authenticating against the
# Swift authentication service
swift_store_key = a86850deb2742ec3cb41518e26aa2d89

# Container within the account that the account should use
# for storing images in Swift
swift_store_container = glance

# Do we create the container if it does not exist?
swift_store_create_container_on_put = False

[app:glance-registry]
paste.app_factory = glance.registry.server:app_factory

# Address to bind the registry server
# bind_host = 0.0.0.0
bind_host = 10.3.40.22

# Port the bind the registry server to
bind_port = 9191

# SQLAlchemy connection string for the reference implementation
# registry server. Any valid SQLAlchemy connection string is fine.
# See: http://www.sqlalchemy.org/docs/05/reference/sqlalchemy/connections.html#sqlalchemy.create_engine
sql_connection = sqlite:///glance.sqlite
# sql_connection = sqlite:///glance.sqlite --daemonize

# Period in seconds after which SQLAlchemy should reestablish its connection
# to the database.
#
# MySQL uses a default `wait_timeout` of 8 hours, after which it will drop
# idle connections. This can result in 'MySQL Gone Away' exceptions. If you
# notice this, you can lower this value to ensure that SQLAlchemy reconnects
# before MySQL can drop the connection.
sql_idle_timeout = 3600

## logging
--log_dir = '/var/log/glance'
--log_file = 'glance.log'
--log-config=/usr/etc/logging.cnf

Revision history for this message
Best Jay Pipes (jaypipes) said :
#5

> ## logging
> --log_dir = '/var/log/glance'
> --log_file = 'glance.log'
> --log-config=/usr/etc/logging.cnf

As I mentioned on
http://docs.openstack.org/cactus/openstack-compute/admin/content/configuring-logging-for-glance.html,
you need to remove the above lines from your glance.conf. You need to
add the following to your glance.conf to enable logging in both the
API and Registry servers:

# In the [app:glance-api] section, put:

log_file = /var/log/glance/api.log

# In the [app:glance-registry] section, put:

log_file = /var/log/glance/registry.log

Restart your servers and logging should be enabled in debug level.
After, please post what is in the API log file. Thanks!
-jay

Revision history for this message
steve chu (steve-chu) said :
#6

Hi Jay, Thank you very much for spending time on this issue. The issus has been resolved. I suggest you to update the doc of configuring the logging of Glance to avoid confusion from users.

Steve

Revision history for this message
Jay Pipes (jaypipes) said :
#7

On Tue, Apr 26, 2011 at 12:52 PM, steve chu
<email address hidden> wrote:
> Question #154239 on Glance changed:
> https://answers.launchpad.net/glance/+question/154239
>
>    Status: Answered => Solved
>
> steve chu confirmed that the question is solved:
> Hi Jay, Thank you very much for spending time on this issue. The issus
> has been resolved. I suggest you to update the doc of configuring the
> logging of Glance to avoid confusion from users.

Will do, Steve! I'll log a bug about it.

Cheers!
jay