mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 17:33:09 +00:00
Merge pull request #81366 from pvgoran/pykms-fix-logging
pykms: fix/enhance logging
This commit is contained in:
commit
83a57cfa31
@ -82,6 +82,7 @@ in {
|
||||
]);
|
||||
ProtectHome = "tmpfs";
|
||||
WorkingDirectory = libDir;
|
||||
SyslogIdentifier = "pykms";
|
||||
Restart = "on-failure";
|
||||
MemoryLimit = cfg.memoryLimit;
|
||||
};
|
||||
|
@ -44,16 +44,14 @@ in buildPythonApplication rec {
|
||||
|
||||
propagatedBuildInputs = [ systemd pytz tzlocal ];
|
||||
|
||||
# Fix https://github.com/SystemRage/py-kms/issues/64 :
|
||||
patches = [ ./log-to-current-directory-by-default.patch ];
|
||||
|
||||
postPatch = ''
|
||||
siteDir=$out/${python3.sitePackages}
|
||||
|
||||
substituteInPlace pykms_DB2Dict.py \
|
||||
--replace "'KmsDataBase.xml'" "'$siteDir/KmsDataBase.xml'"
|
||||
|
||||
# we are logging to journal
|
||||
sed -i pykms_Misc.py \
|
||||
-e '6ifrom systemd import journal' \
|
||||
-e 's/log_obj.addHandler(log_handler)/log_obj.addHandler(journal.JournalHandler())/'
|
||||
'';
|
||||
|
||||
format = "other";
|
||||
|
@ -0,0 +1,20 @@
|
||||
# By default, create log files in current directory, instead of the script directory.
|
||||
--- ../original/py-kms/pykms_Client.py
|
||||
+++ py-kms/pykms_Client.py
|
||||
@@ -48,5 +48,5 @@
|
||||
'choi' : ["CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG", "MINI"]},
|
||||
'lfile' : {'help' : 'Use this option to set an output log file. The default is \"pykms_logclient.log\" or type \"STDOUT\" to view log info on stdout.',
|
||||
- 'def' : os.path.dirname(os.path.abspath( __file__ )) + "/pykms_logclient.log", 'des' : "logfile"},
|
||||
+ 'def' : "pykms_logclient.log", 'des' : "logfile"},
|
||||
'lsize' : {'help' : 'Use this flag to set a maximum size (in MB) to the output log file. Desactivated by default.', 'def' : 0, 'des': "logsize"},
|
||||
}
|
||||
--- ../original/py-kms/pykms_Server.py
|
||||
+++ py-kms/pykms_Server.py
|
||||
@@ -85,5 +85,5 @@
|
||||
'choi' : ["CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG", "MINI"]},
|
||||
'lfile' : {'help' : 'Use this option to set or not an output log file. The default is \"pykms_logserver.log\" or type \"STDOUT\" to view log info on stdout.',
|
||||
- 'def' : os.path.dirname(os.path.abspath( __file__ )) + "/pykms_logserver.log", 'des' : "logfile"},
|
||||
+ 'def' : "pykms_logserver.log", 'des' : "logfile"},
|
||||
'lsize' : {'help' : 'Use this flag to set a maximum size (in MB) to the output log file. Desactivated by default.', 'def' : 0, 'des': "logsize"},
|
||||
}
|
||||
'');
|
Loading…
Reference in New Issue
Block a user