1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 Ricardo Wurmus <rekado@elephly.net>
3 ;;; Copyright © 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2017 Stefan Reichör <stefan@xsteve.at>
5 ;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
6 ;;; Copyright © 2018–2022 Tobias Geerinckx-Rice <me@tobias.gr>
7 ;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com>
8 ;;; Copyright © 2019 Meiyo Peng <meiyo@riseup.net>
9 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
10 ;;; Copyright © 2021 Guillaume Le Vaillant <glv@posteo.net>
12 ;;; This file is part of GNU Guix.
14 ;;; GNU Guix is free software; you can redistribute it and/or modify it
15 ;;; under the terms of the GNU General Public License as published by
16 ;;; the Free Software Foundation; either version 3 of the License, or (at
17 ;;; your option) any later version.
19 ;;; GNU Guix is distributed in the hope that it will be useful, but
20 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;;; GNU General Public License for more details.
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
27 (define-module (gnu packages logging)
28 #:use-module ((guix licenses) #:prefix license:)
29 #:use-module (guix packages)
30 #:use-module (guix utils)
31 #:use-module (guix download)
32 #:use-module (guix git-download)
33 #:use-module (guix build-system cmake)
34 #:use-module (guix build-system gnu)
35 #:use-module (guix build-system python)
36 #:use-module (gnu packages)
37 #:use-module (gnu packages autotools)
38 #:use-module (gnu packages bison)
39 #:use-module (gnu packages c)
40 #:use-module (gnu packages compression)
41 #:use-module (gnu packages curl)
42 #:use-module (gnu packages cyrus-sasl)
43 #:use-module (gnu packages databases)
44 #:use-module (gnu packages flex)
45 #:use-module (gnu packages geo)
46 #:use-module (gnu packages gnupg)
47 #:use-module (gnu packages kerberos)
48 #:use-module (gnu packages linux)
49 #:use-module (gnu packages ncurses)
50 #:use-module (gnu packages networking)
51 #:use-module (gnu packages perl)
52 #:use-module (gnu packages pkg-config)
53 #:use-module (gnu packages python)
54 #:use-module (gnu packages python-build)
55 #:use-module (gnu packages python-web)
56 #:use-module (gnu packages python-xyz)
57 #:use-module (gnu packages tcl)
58 #:use-module (gnu packages tls))
60 (define-public log4cpp
66 (uri (string-append "mirror://sourceforge/log4cpp/log4cpp-"
67 (version-major+minor version) ".x%20%28new%29"
68 "/log4cpp-" (version-major+minor version)
69 "/log4cpp-" version ".tar.gz"))
72 "07gmr3jyaf2239n9sp6h7hwdz1pv7b7aka8n06gmr2fnlmaymfrc"))))
73 (build-system gnu-build-system)
76 (modify-phases %standard-phases
77 (add-after 'unpack 'do-not-call-stime
79 ;; Patch out use of 'stime' which was removed from glibc 2.31.
80 ;; The test would not work in the build container anyway.
81 (substitute* "tests/testDailyRollingFileAppender.cpp"
82 (("if \\(stime\\(&now\\) == -1\\)")
85 (synopsis "Log library for C++")
87 "Log4cpp is library of C++ classes for flexible logging to files, syslog,
88 IDSA and other destinations. It is modeled after the Log4j Java library,
89 staying as close to their API as is reasonable.")
90 (home-page "http://log4cpp.sourceforge.net/")
91 (license license:lgpl2.1+)))
97 (home-page "https://github.com/google/glog")
100 (uri (git-reference (url home-page)
101 (commit (string-append "v" version))))
104 "17014q25c99qyis6l3fwxidw6222bb269fdlr74gn7pzmzg4lvg3"))
105 (file-name (git-file-name name version))))
106 (build-system cmake-build-system)
108 (list perl ;for tests
109 autoconf automake libtool))
110 (synopsis "C++ logging library")
112 "Google glog is a library that implements application-level logging.
113 This library provides logging APIs based on C++-style streams and various
114 helper macros. You can log a message by simply streaming things to log at a
115 particular severity level. It allows logging to be controlled from the
117 (license license:bsd-3)))
119 ;; This is the legacy version of the tailon package. The new version, written
120 ;; in Go in available here: https://github.com/gvalkov/tailon.
121 (define-public tailon
128 (uri (pypi-uri name version))
131 "0xkmrivzilsc9wqr8ms67v7399gxnh7pv5687k4rdpdgz4309fwc"))))
132 (build-system python-build-system)
134 (list python-tox python-wheel))
136 (list python-pyyaml-5 python-sockjs-tornado python-tornado-http-auth
137 python-tornado python-deepmerge))
140 (modify-phases %standard-phases
141 (add-after 'unpack 'patch-commands.py
143 (substitute* "tailon/commands.py"
144 (("self\\.first_in_path\\('grep'\\)")
145 (string-append"'" (which "grep") "'"))
146 (("self\\.first_in_path\\('gawk', 'awk'\\)")
147 (string-append"'" (which "gawk") "'"))
148 (("self\\.first_in_path\\('gsed', 'sed'\\)")
149 (string-append"'" (which "sed") "'"))
150 (("self\\.first_in_path\\('gtail', 'tail'\\)")
151 (string-append"'" (which "tail") "'")))))
152 (add-after 'unpack 'relax-requirements
154 (substitute* "setup.py"
155 ((",<5.0.0") "")))))))
156 (home-page "https://tailon.readthedocs.io/")
158 "Webapp for looking at and searching through log files")
160 "Tailon provides a web interface around the tail, grep, awk and sed
161 commands, displaying the results via a web interface.")
162 (license license:bsd-3)))
164 (define-public multitail
171 (uri (string-append "https://vanheusden.com/multitail/multitail-"
174 (base32 "1vd9vdxyxsccl64ilx542ya5vlw2bpg6gnkq1x8cfqy6vxvmx7dj"))))
175 (build-system gnu-build-system)
178 (list (string-append "CC=" ,(cc-for-target))
179 (string-append "PREFIX="
180 (assoc-ref %outputs "out")))
182 (modify-phases %standard-phases
183 (add-after 'unpack 'patch-curses-lib
184 (lambda* (#:key outputs #:allow-other-keys)
185 (let ((out (assoc-ref outputs "out")))
187 (("ncursesw\\/panel.h") "panel.h")
188 (("ncursesw\\/ncurses.h") "ncurses.h")))
190 (delete 'configure)) ; no configure script
191 #:tests? #f)) ; no test suite (make check just runs cppcheck)
192 (inputs (list ncurses))
193 (home-page "https://vanheusden.com/multitail/")
194 (synopsis "Monitor multiple log files")
196 "MultiTail can monitor, color, filter, and merge log files and command
197 output in multiple windows in a terminal.")
198 (license license:gpl2+)))
200 (define-public spdlog
208 (url "https://github.com/gabime/spdlog")
209 (commit (string-append "v" version))))
210 (file-name (git-file-name name version))
212 (base32 "02xz017ba9fssm1rp1fcfld7h79awbr6fqai9dxaqp02akp3davk"))))
213 (build-system cmake-build-system)
214 ;; TODO run benchmark. Currently not possible, as adding
215 ;; (gnu packages benchmark) forms a dependency cycle
218 (list "-DSPDLOG_BUILD_BENCH=OFF"
219 "-DSPDLOG_BUILD_SHARED=ON"
220 "-DSPDLOG_BUILD_TESTS=ON")))
221 (home-page "https://github.com/gabime/spdlog")
222 (synopsis "Fast C++ logging library")
223 (description "Spdlog is a very fast header-only/compiled C++ logging
225 ;; spdlog is under Expat license, but the bundled fmt library in
226 ;; "include/spdlog/fmt/bundled" is under BSD 2 clause license.
227 (license (list license:expat license:bsd-2))))
229 (define-public rsyslog
237 (url "https://github.com/rsyslog/rsyslog.git")
238 (commit (string-append "v" version))))
239 (file-name (git-file-name name version))
241 (base32 "0bsd1n3n4hvlkwf4g85g3fg37mnvkdmxsfdmg273gcachhyl5hbx"))))
242 (build-system gnu-build-system)
246 '(modify-phases %standard-phases
247 ;; autogen.sh calls configure at the end of the script.
249 (lambda _ (invoke "autoreconf" "-vfi"))))
251 ;; Rsyslog comes with a plethora of optional modules. We enable most of
252 ;; them for a full-featured build.
253 '(list "--enable-kmsg"
254 "--enable-liblogging_stdlog"
255 "--enable-unlimited_select"
259 "--enable-imbatchreport"
261 "--enable-imdiag" ;for full tests
268 "--enable-imtuxedoulog"
271 "--enable-clickhouse"
272 "--enable-elasticsearch"
275 "--enable-omfile_hardened"
283 "--enable-omudpspoof"
287 "--enable-pmaixforwardedfrom"
288 "--enable-pmciscoios"
289 "--enable-pmcisconames"
292 "--enable-pmnormalize"
297 ;; Message Modification Modules
302 "--enable-mmdblookup"
304 "--enable-mmjsonparse"
305 "--enable-mmkubernetes"
306 "--enable-mmnormalize"
307 "--enable-mmpstrucdata"
308 "--enable-mmrfc5424addhmac"
309 "--enable-mmrm1stspace"
310 "--enable-mmsequence"
311 "--enable-mmsnmptrapd"
312 "--enable-mmtaghostname"
323 "--enable-gssapi-krb5"
327 "--enable-fmhash_xxhash"
329 ;; Needed to build rscryutil.1.gz.
330 "--enable-generate-man-pages")))
338 python-docutils)) ; rst2man for man pages
361 (list util-linux "lib")
364 (home-page "https://www.rsyslog.com/")
365 (synopsis "RSYSLOG is a flexible and fast system for log processing")
367 "Rsyslog offers high-performance, great security features and a modular
368 design. While it started as a regular syslogd, rsyslog has evolved into a
369 kind of swiss army knife of logging, being able to accept inputs from a wide
370 variety of sources, transform them, and output the results to diverse
372 ;; Most of the source code is licensed under the LGPL3+ with many source
373 ;; files licensed under the terms of the ASL2.0. Some modules are
374 ;; licensed under GPL3+.
375 (license (list license:lgpl3+