File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,20 @@ Commands:
59
59
nrt Run NRT Sea Ice ECDR.
60
60
```
61
61
62
+ ### Logging
63
+
64
+ By default, logs are written to disk at
65
+ ` /share/apps/G02202_V5/{ECDR_PRODUCT_VERSION}/{YYYY-MM-DD}.log ` . Up to 31 of
66
+ these logs can exist at once (older log files get removed).
67
+
68
+ During large re-processing efforts, it may be desirable to temporarily disable
69
+ logging to improve processing speed and reduce disk usage. To do so, set the
70
+ ` DISABLE_FILE_LOGGING ` envvar to ` TRUE ` .
71
+
72
+ ```
73
+ export DISABLE_FILE_LOGGING=TRUE
74
+ ```
75
+
62
76
## Development/contributing
63
77
64
78
See [ doc/development.md] ( doc/development.md ) for more information.
Original file line number Diff line number Diff line change 23
23
# regular ops runs up to a certain date, which might help w/ debugging
24
24
# issues...Larger reprocessing efforts could disable file logging (or change the
25
25
# level?) for speed and space consideration issues.
26
- do_not_log = os .environ .get ("DISABLE_FILE_LOGGING" )
26
+ disable_file_logging = os .environ .get ("DISABLE_FILE_LOGGING" )
27
+ do_not_log = disable_file_logging is not None and disable_file_logging .upper () in (
28
+ "TRUE" ,
29
+ "YES" ,
30
+ )
31
+
27
32
if not do_not_log :
28
33
# One file per day.
29
34
file_sink_fp = LOGS_DIR / "{time:%Y-%m-%d}.log"
35
+ logger .debug (f"Logging to { file_sink_fp } " )
30
36
logger .add (
31
37
file_sink_fp ,
32
38
level = DEFAULT_LOG_LEVEL ,
33
39
# Retain logs for up to a month.
34
40
retention = 31 ,
35
41
)
42
+ else :
43
+ logger .debug (f"Not logging to file (DISABLE_FILE_LOGGING={ disable_file_logging } )." )
You can’t perform that action at this time.
0 commit comments