1 """
2 Helper code for logging to files.
3
4 All logs that could be used both interactively and from the web server
5 but have group ownership gavo and mode (at least) 664. Only then can
6 both parties write logs.
7
8 The RotatingFileHandler in this module tries to ensure this.
9 """
10
11
12
13
14
15
16
17 import grp
18 import os
19 import warnings
20 from logging import handlers
21
22 from gavo import base
23
24
25 try:
26 GAVO_GROUP_ID = grp.getgrnam(base.getConfig("group"))[2]
27 except KeyError:
28 warnings.warn("Cannot figure out id of group '%s'. Logging will break.")
29 GAVO_GROUP_ID = -1
30
31
33 """logging.handler.RotatingFile with forced group support.
34 """
38
47
51