git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #87219 from serokell/kirelagin/postgres-no-time

postgres: Do not log timestamp

commit85a05878846b75254f97b8690c18a470cfe982f0 authorLinus Heckemann <git@sphalerite.org> dateThu 14 May 2020, 08:34 (7 years ago) parentce9ed9b084bd32
1 file changed+12
nixos/modules/services/databases/postgresql.nix+12
nixos/modules/services/databases/postgresql.nix+12
@@ -17,6 +17,7 @@ let
1717 hba_file = '${pkgs.writeText "pg_hba.conf" cfg.authentication}'
1818 ident_file = '${pkgs.writeText "pg_ident.conf" cfg.identMap}'
1919 log_destination = 'stderr'
20+ log_line_prefix = '${cfg.logLinePrefix}'
2021 listen_addresses = '${if cfg.enableTCPIP then "*" else "localhost"}'
2122 port = ${toString cfg.port}
2223 ${cfg.extraConfig}
@@ -186,6 +187,17 @@ in
186187 '';
187188 };
188189
190+ logLinePrefix = mkOption {
191+ type = types.str;
192+ default = "[%p] ";
193+ example = "%m [%p] ";
194+ description = ''
195+ A printf-style string that is output at the beginning of each log line.
196+ Upstream default is <literal>'%m [%p] '</literal>, i.e. it includes the timestamp. We do
197+ not include the timestamp, because journal has it anyway.
198+ '';
199+ };
200+
189201 extraPlugins = mkOption {
190202 type = types.listOf types.path;
191203 default = [];