CDR Tickets

Issue Number 3947
Summary Adding Tier/Host to Log Class
Created 2015-08-04 12:50:07
Issue Type Improvement
Submitted By Englisch, Volker (NIH/NCI) [C]
Assigned To Shah, Aarti (NIH/NIDDK) [C] [X]
Status Closed
Resolved 2016-02-09 17:06:49
Resolution Fixed
Path /home/bkline/backups/jira/ocecdr/issue.166657
Description

When inspecting log files provided by CBIIT from the upper tiers it can be useful having a way to confirm the logs are actually coming from the host we thought the would come from.

Alan suggested to update the LOG class to output this information.

Comment entered 2015-08-04 20:00:30 by alan

This will be a very small and simple change but it will happen in cdr.py, one of our most actively updated files. Assuming we want to install it in Darwin, I'll hold off making the change until we have the Curie svn branch merged into trunk.

Comment entered 2016-02-09 17:06:13 by alan

I made two changes:

If a banner is written when opening the log file, I will always write the Tier name beneath it along with the datetime.

If the programmer creates the Log object with logTier=True, I'll also prepend it to each message. The default for logTier is False.

Here is an example of the behaviors. In the first opening there is a banner but logTier is False. In the second there is a banner and logTier is True.


=== Opening Test log ===
TIER: DEV  DATETIME: Tue Feb 09 16:45:23 2016
!3504: Tue Feb 09 16:45:23 2016: This is a test msg
!3504: Tue Feb 09 16:45:23 2016: And another

Tue Feb 09 16:45:23 2016
=========== Closing Log ===========


=== Opening Test log ===
TIER: DEV  DATETIME: Tue Feb 09 16:49:57 2016
DEV:!1452: Tue Feb 09 16:49:57 2016: This is a test msg
DEV:!1452: Tue Feb 09 16:49:57 2016: And another

Tue Feb 09 16:49:57 2016
=========== Closing Log ===========

I am happy to entertain suggestions for improving it.

Comment entered 2016-03-22 15:17:18 by Englisch, Volker (NIH/NCI) [C]

I've tested this on DEV and it is working as expected. Some of our *.log files are now displaying the tier on which the log file is located.

Comment entered 2016-05-13 14:50:03 by Englisch, Volker (NIH/NCI) [C]

I confirmed in the Jobmaster.log file that the tier is included in the log file.

Closing ticket.

Elapsed: 0:00:00.001386