Closed georgemarselis-nvi closed 1 year ago
I am not sure if we need to maintain a SQL database for the logs. Any specific reason for this?
It will be an sqlite3 file, I mean, not a whole host. And yes, metrics (and some professional curiosity) and if we have enough data, a paper.
I was agonizing for over a week over this feature request: add proper syslog/logging to this demultiplexing pipeline: Learn how to log things beyond a print() statement, what counts as info, warning and critical^[1] , what is useful and what is not, how to log to multiple locations/destinations, how to log to console with color, while sending the same message unformatted to syslog and file...
... then i just bit the bullet: copied over all the output messages to a new script that prints the same things but does none of the work and said "let me play with that". At last, i got something I can start working with.
... moving right along, i guess. better to produce something imperfect than nothing at all (or worse, wait for your inner davinci to wake up)
[1] at least i knew what counted as debug!
Lots of good progress tonight.
Tomorrow: figuring out how to write messages using formatters according to destination.
do we need millisecond stamping, or is second good enough? datefmt = '%Y-%m-%d %H:%M:%S' vs datefmt = '%Y-%m-%d %H:%M:%S.%f'[:-3]
logging run log, , implemented
cumulative run log, , implemented
syslog log, , implemented
email log, success, implemented, needs testing
email log, failures( many points of ), implemented, needs testing
workplace notifications on the horizon.
update: only thing left is workplace notifications, for now.
email notifications on failures, need refactoring to modularize then so we can test them
this is not a blocking issue for version 1.0
if add-ins are needed, we can come back.
removing from starred issues.
this issue is like a well done steak. Closing.
What has to be done
-[ ] log to syslog so later on we can ship the logs -[ ] log to file log file hierarchy is roughly outlined below
THOUGHTS ABOUT LOGGING
[x] Logging should be done on every step
[x] if you set demux.debug on the object, you will get debug information this needs to be expanded and worked on on a separate ticket
[x] Logging happens on stdout, not stderr
[x] Errors are logged on stderr, only
[x] Log to syslog
[x] stdout as INFO
[x] stderr as WARNING or ERROR
[x] sys.exit as CRITICAL
Files created:
[x] RunIDDir/demultiplex_log
[x] RunIDDir/demultiplex_log/00_script.log
[x] RunIDDir/demultiplex_log/01_blc2fastq.log
[x] RunIDDir/demultiplex_log/02_FastQC.log
[x] RunIDDir/demultiplex_log/03_MultiQC.log
[ ] RunIDDir/demultiplex_log/04_NIRD.log
[x] RunIDDir/demultiplex_log/05_VIGASP.log /data/log/RunID.log ( copy of RunIDDir/Logs/00_script.log / symlink to RunID/Logs/00_script.log ? )
[x] /data/log/demultiplex.log (cumulative log)
/data/Logs/script.log ( copy of RunIDDir/Logs/00_script.log - gets rotated/overwritten with each run )/data/Logs/current_run_00.log/data/Logs/current_run_01.log if _00 exists and so on[x] overwrite when starting a new run
[x] /data/log/script_cumulative.log ( cumulative - does not get rotated, append )
Actions taken
[ ] Email on parsing configuration file error
[x] Email send on completion
[x] Email sent on error
[x] run did not complete (specific step)
disk full (no, belongs to nagios)[ ] Email sent on run looping detected
[ ] Email sent on parsing error of SampleSheet.csv
[ ] Email on completion of NIRD upload
[ ] Email on completion of VIGASP upload
[ ] Email on completion of LIMS upload
if you run the script interactively:
[x] Color:
[x] Console: console has color
[x] Files: files do not have color
-[ ] Console: console has "Time since started" and "time since started this step" save to SQL database each time stamp? -[ ] Files: files get regular current timestamp on each step
if you run the script non-interactively
[x] Color:
[x] Console: no console
[x] Files: files do not have color
[x] Timestamps:
[x] Console: no console
[x] Files: files get regular current timestamp on each step
End of logging:
[ ] Time:
[ ] how much time the whole procedure took
[ ] how much each step
[ ] save times to SQL database?