pytroll / pytroll-collectors

Collector modules for Pytroll
GNU General Public License v3.0
3 stars 19 forks source link

trollstalker ignores logging config, instead writes "yep, processed" to stdout for every file #158

Open gerritholl opened 1 day ago

gerritholl commented 1 day ago

The package 'trollstalker' ignores the logging configuration. Instead, for every file coming it, it prints a message "yep, processed" to stdout.

$ trollstalker.py -c trollstalker.ini -C fci-fdhsi-fd -n localhost

gives

yep, processed
yep, processed
yep, processed
yep, processed
yep, processed

and so on. Meanwhile, the corresponding logging file does not get created.

Configuration file (relevant part):

[fci-fdhsi-fd]
topic=/file/fci/fdhsi-fd
directory=/data/pytroll/IN/FCI_FDHSI/
posttroll_port=0
publish_port=
event_names=IN_MOVED_TO,IN_CREATE
loglevel=DEBUG
stalker_log_config=/opt/pytroll/pytroll_inst/config/trollstalker_logging.ini
filepattern={path}W_XX-EUMETSAT-Darmstadt,IMG+SAT,{platform_name:_<4s}+FCI-1C-RRAD-FDHSI-FD--CHK-{segment:_<4s}--{purpose}-NC4E_C_EUMT_{proc_time:%Y%m%d%H%M%S}_{facility_or_tool}_{environment}_{start_time:%Y%m%d%H%M%S}_{end_time:%Y%m%d%H%M%S}_N_{special_compression}_{disposition_mode}_{repeat_cycle_in_day:>04d}_{count_in_repeat_cycle:>04d}.nc
instruments=fci
history=0
nameservers=localhost

Logging configuration:

[loggers]
keys=root,trollstalker

[handlers]
keys=consoleHandler,fileHandler

[formatters]
keys=simpleFormatter

[logger_root]
level=DEBUG
handlers=consoleHandler,fileHandler

[logger_trollstalker]
level=DEBUG
handlers=consoleHandler,fileHandler
qualname=trollstalker
propagate=0

[handler_consoleHandler]
class=StreamHandler
level=DEBUG
formatter=simpleFormatter
args=(sys.stdout,)

[handler_fileHandler]
class=handlers.TimedRotatingFileHandler
level=DEBUG
formatter=simpleFormatter
args=("/opt/pytroll/pytroll_inst/log/trollstalker.log", 'midnight', 1, 7, None, True, True)

[formatter_simpleFormatter]
format=[%(levelname)s: %(asctime)s: %(name)s] %(message)s
datefmt=

It was working in pytroll-collectors 0.15.1, but it fails in pytroll-collectors 0.16.

gerritholl commented 1 day ago

git bisect seems to suggest the problem was introduced in 2b0ec74cee641cb8c81ba10a77a11503360a604e, although I'm not quite sure, as there was an intermediate period in which trollstalker was not functioning at all (see #149).

gerritholl commented 1 day ago