[ckan-dev] Problems installing CKAN, logging

Adrià Mercader adria.mercader at okfn.org
Wed Jun 5 09:03:27 UTC 2013


Hi Hilde,

If you want to write the log to a file you need to use a different
handler than the console one, either FileHandler or
RotatingFileHandler.

What instructions did you follow for this? They may need clarification.

Here is an example:

[handler_file]
class = logging.handlers.RotatingFileHandler
formatter = generic
level = NOTSET
args = ('/var/log/ckan/default/production.log', 'a', 2000000, 9)


More details here:

http://docs.python.org/2/library/logging.handlers.html#module-logging.handlers


Adrià

On 4 June 2013 19:14, Hildegard Gerlach
<hildegard.gerlach at jrc.ec.europa.eu> wrote:
> Hello,
>
> I am new to CKAN and tried to install it on RedHat. I followed the
> instructions on
> https://github.com/okfn/ckan/wiki/How-to-Install-CKAN-2.0-on-CentOS-6.3#wiki-Download_and_install_CKAN
>
> I had a first problem not having the paster command. It seems that the
> PasteScript Package was missing in the file pip-requirements.txt.
>
> After having solved this, I have the following problem:
> After having created the configuration file development.ini as described
> paster --plugin=ckan sysadmin add admin --config=development.ini
>
> I changed this line for the ckan logfile as described in the instructions
>
>  args = ("/var/log/ckan/[DNS]/ckan.log", "a", 20000000, 9)
>
> so I get the following part in development.ini
>
> [handler_console]
> class = StreamHandler
> args = ("/var/log/ckan/mtester.ies.jrc.it/ckan.log", "a", 20000000, 9,)
> level = NOTSET
> formatter = generic
>
> but it seems that the arguments are not accepted, see for example output of
> this command
>
> (pyenv)[ckan at mtester ckan]$ paster --plugin=ckan user list
> --config=development.ini
> Traceback (most recent call last):
>   File "/usr/local/mtester.ies.jrc.it/pyenv/bin/paster", line 8, in <module>
>     load_entry_point('PasteScript==1.7.5', 'console_scripts', 'paster')()
>   File
> "/usr/local/mtester.ies.jrc.it/pyenv/lib/python2.6/site-packages/paste/script/command.py",
> line 104, in run
>     invoke(command, command_name, options, args[1:])
>   File
> "/usr/local/mtester.ies.jrc.it/pyenv/lib/python2.6/site-packages/paste/script/command.py",
> line 143, in invoke
>     exit_code = runner.run(args)
>   File
> "/usr/local/mtester.ies.jrc.it/pyenv/lib/python2.6/site-packages/paste/script/command.py",
> line 238, in run
>     result = self.command()
>   File "/usr/local/mtester.ies.jrc.it/pyenv/src/ckan/ckan/lib/cli.py", line
> 601, in command
>     self._load_config()
>   File "/usr/local/mtester.ies.jrc.it/pyenv/src/ckan/ckan/lib/cli.py", line
> 80, in _load_config
>     fileConfig(self.filename)
>   File
> "/usr/local/mtester.ies.jrc.it/pyenv/lib/python2.6/site-packages/paste/script/util/logging_config.py",
> line 85, in fileConfig
>     handlers = _install_handlers(cp, formatters)
>   File
> "/usr/local/mtester.ies.jrc.it/pyenv/lib/python2.6/site-packages/paste/script/util/logging_config.py",
> line 158, in _install_handlers
>     h = apply(klass, args)
> TypeError: __init__() takes at most 2 arguments (5 given)
>
> Only if I write
> args = ("/var/log/ckan/ckan.log",)
>
>
> I seem to have the correct number of arguments, but the logfile is never
> created, it seems that the StreamHandler cannot write to it (I got an error
> message when installing the ckanext-harvest extension).
>
> Can anybody help ?
>
> Thanks a lot
>
> Hilde Gerlach
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> http://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: http://lists.okfn.org/mailman/options/ckan-dev
>




More information about the ckan-dev mailing list