Task #9608 (closed)
BUG: omeroweb.connector module does not log
Reported by: | cneves | Owned by: | atarkowska |
---|---|---|---|
Priority: | major | Milestone: | OMERO-4.4.x |
Component: | Web | Version: | 4.4.9 |
Keywords: | n.a. | Cc: | python-team@… |
Resources: | n.a. | Referenced By: | n.a. |
References: | n.a. | Remaining Time: | 0.0d |
Sprint: | n.a. |
Description
Even though log usage follows the pattern used everywhere else, there's probably some import that is changing the root logger settings for connector.py, making it silent.
Change History (6)
comment:1 Changed 12 years ago by cneves
- Status changed from new to accepted
comment:2 Changed 11 years ago by atarkowska
- Version set to 4.4.9
Seems to work well
2013-11-04 13:42:08,782 DEBUG [ omeroweb.connector] (proc.08539) join_connection:191 Successfully joined connection: ... 2013-11-04 13:42:08,783 DEBUG [ omeroweb.connector] (proc.08539) prepare_gateway:157 Successfully prepared gateway: ...
comment:3 Changed 11 years ago by atarkowska
- Owner changed from cneves to atarkowska
comment:4 Changed 11 years ago by atarkowska
comment:5 Changed 11 years ago by atarkowska
- Resolution set to fixed
- Status changed from accepted to closed
comment:6 Changed 10 years ago by Aleksandra Tarkowska <A.Tarkowska@…>
- Remaining Time set to 0
(In [3f0231a4479e84abd00328c253a70d9c5f0df293/ome.git] on branch develop) fixing logging connector.py, close #9608
Note: See
TracTickets for help on using
tickets.
You may also have a look at Agilo extensions to the ticket.
The reason this happens is twofold; The connector module is initialized (first imported) inside the settings.py file, and the LOGGING dictionary which is used to set up logging as per the django framework init sequence has 'disable_existing_loggers' set to True.
Simply switching the latter to False fixes this problem and I don't see any obvious side effects to that, at least on OmeroWeb, as django does not use any default logging setup if LOGGING is defined in settings.py, and the commit (https://github.com/openmicroscopy/openmicroscopy/commit/4bd273655194b6e7e4933c664d39212f88e066d7) that introduced this does not describe a reason for it.
Alternatively we can try to move the import away from settings.py. I have tried this approach and frankly it appears to be slightly more complex than it should, as the code that uses it is initializing the Server class frozen list of servers and doing that at other points in the code appears to break the login process. The metaclass extensions done in the Server class feel like they are a bit over the top and refactoring that is probably a good idea, but that is probably outside the scope of this particular issue.
My vote goes for the change in https://github.com/cneves/openmicroscopy/commit/5a657125a8476a118291b43feb2bee87385394fb
If there are any objections, speak up, otherwise I'll open a pull request.