[ckan-dev] Problems installing CKAN, logging

Hildegard Gerlach hildegard.gerlach at jrc.ec.europa.eu
Thu Jun 6 09:29:48 UTC 2013


Dear Adrià,

thanks so much for bringing me into the right direction. I had to add 
file also to [handlers] and substitute console with file  in [logger-ckan].
Might seem obvious, but was not for me in the beginning.

I followed these instructions
https://github.com/okfn/ckan/wiki/How-to-Install-CKAN-2.0-on-CentOS-6.3#wiki-Final_CKAN_Configuration

where you just see
>
>
>       Configure CKAN for Deployment via httpd
>
> Edit |/usr/local/[DNS]/pyenv/src/ckan/development.ini| and change its 
> log location as follows:
>
>   args = ("/var/log/ckan/[DNS]/ckan.log", "a", 20000000, 9)
https://github.com/okfn/ckan/wiki/How-to-Install-CKAN-2.0-on-CentOS-6.3#wiki-Configure_CKAN_for_Deployment_via_httpd

Probably should be explained better.
________________________________________________________

I would like to point out another issue:
As I had written in my previous message, there was an issue with a 
missing package in pip-requirements.txt
https://github.com/okfn/ckan/blob/master/pip-requirements.txt

PasteScript package is missing

I added it to the file to get it installed, otherwise the paster command 
is missing.
PasteScript==1.7.5

Thanks again, probably I will soon come up with some other issue.

Hilde


On 05/06/2013 11:03, Adrià Mercader wrote:
> 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
>>
> _______________________________________________
> 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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20130606/6f0f0351/attachment-0001.html>


More information about the ckan-dev mailing list