logging.scm 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  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–2021 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>
  11. ;;;
  12. ;;; This file is part of GNU Guix.
  13. ;;;
  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.
  18. ;;;
  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.
  23. ;;;
  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/>.
  26. (define-module (gnu packages logging)
  27. #:use-module ((guix licenses) #:prefix license:)
  28. #:use-module (guix packages)
  29. #:use-module (guix utils)
  30. #:use-module (guix download)
  31. #:use-module (guix git-download)
  32. #:use-module (guix build-system cmake)
  33. #:use-module (guix build-system gnu)
  34. #:use-module (guix build-system python)
  35. #:use-module (gnu packages)
  36. #:use-module (gnu packages autotools)
  37. #:use-module (gnu packages bison)
  38. #:use-module (gnu packages c)
  39. #:use-module (gnu packages compression)
  40. #:use-module (gnu packages curl)
  41. #:use-module (gnu packages cyrus-sasl)
  42. #:use-module (gnu packages databases)
  43. #:use-module (gnu packages flex)
  44. #:use-module (gnu packages geo)
  45. #:use-module (gnu packages gnupg)
  46. #:use-module (gnu packages kerberos)
  47. #:use-module (gnu packages linux)
  48. #:use-module (gnu packages ncurses)
  49. #:use-module (gnu packages networking)
  50. #:use-module (gnu packages perl)
  51. #:use-module (gnu packages pkg-config)
  52. #:use-module (gnu packages python)
  53. #:use-module (gnu packages python-web)
  54. #:use-module (gnu packages python-xyz)
  55. #:use-module (gnu packages tcl)
  56. #:use-module (gnu packages tls))
  57. (define-public log4cpp
  58. (package
  59. (name "log4cpp")
  60. (version "1.1.3")
  61. (source (origin
  62. (method url-fetch)
  63. (uri (string-append "mirror://sourceforge/log4cpp/log4cpp-"
  64. (version-major+minor version) ".x%20%28new%29"
  65. "/log4cpp-" (version-major+minor version)
  66. "/log4cpp-" version ".tar.gz"))
  67. (sha256
  68. (base32
  69. "07gmr3jyaf2239n9sp6h7hwdz1pv7b7aka8n06gmr2fnlmaymfrc"))))
  70. (build-system gnu-build-system)
  71. (arguments
  72. '(#:phases
  73. (modify-phases %standard-phases
  74. (add-after 'unpack 'do-not-call-stime
  75. (lambda _
  76. ;; Patch out use of 'stime' which was removed from glibc 2.31.
  77. ;; The test would not work in the build container anyway.
  78. (substitute* "tests/testDailyRollingFileAppender.cpp"
  79. (("if \\(stime\\(&now\\) == -1\\)")
  80. "if (1)"))
  81. #t)))))
  82. (synopsis "Log library for C++")
  83. (description
  84. "Log4cpp is library of C++ classes for flexible logging to files, syslog,
  85. IDSA and other destinations. It is modeled after the Log4j Java library,
  86. staying as close to their API as is reasonable.")
  87. (home-page "http://log4cpp.sourceforge.net/")
  88. (license license:lgpl2.1+)))
  89. (define-public glog
  90. (package
  91. (name "glog")
  92. (version "0.5.0")
  93. (home-page "https://github.com/google/glog")
  94. (source (origin
  95. (method git-fetch)
  96. (uri (git-reference (url home-page)
  97. (commit (string-append "v" version))))
  98. (sha256
  99. (base32
  100. "17014q25c99qyis6l3fwxidw6222bb269fdlr74gn7pzmzg4lvg3"))
  101. (file-name (git-file-name name version))))
  102. (build-system cmake-build-system)
  103. (native-inputs
  104. (list perl ;for tests
  105. autoconf automake libtool))
  106. (synopsis "C++ logging library")
  107. (description
  108. "Google glog is a library that implements application-level logging.
  109. This library provides logging APIs based on C++-style streams and various
  110. helper macros. You can log a message by simply streaming things to log at a
  111. particular severity level. It allows logging to be controlled from the
  112. command line.")
  113. (license license:bsd-3)))
  114. (define-public tailon
  115. (package
  116. (name "tailon")
  117. (version "1.3.0")
  118. (source
  119. (origin
  120. (method url-fetch)
  121. (uri (pypi-uri name version))
  122. (sha256
  123. (base32
  124. "0wl2wm6p3pc0vkk33s7rzgcfvs9cwxfmlz997pdfhlw72r00l7s5"))))
  125. (build-system python-build-system)
  126. (inputs
  127. (list python-pyyaml python-sockjs-tornado python-tornado-http-auth
  128. python-tornado))
  129. (arguments
  130. `(#:phases
  131. (modify-phases %standard-phases
  132. (add-after 'unpack 'patch-commands.py
  133. (lambda args
  134. (substitute* "tailon/commands.py"
  135. (("self\\.first_in_path\\('grep'\\)")
  136. (string-append"'" (which "grep") "'"))
  137. (("self\\.first_in_path\\('gawk', 'awk'\\)")
  138. (string-append"'" (which "gawk") "'"))
  139. (("self\\.first_in_path\\('gsed', 'sed'\\)")
  140. (string-append"'" (which "sed") "'"))
  141. (("self\\.first_in_path\\('gtail', 'tail'\\)")
  142. (string-append"'" (which "tail") "'")))
  143. #t)))))
  144. (home-page "https://tailon.readthedocs.io/")
  145. (synopsis
  146. "Webapp for looking at and searching through log files")
  147. (description
  148. "Tailon provides a web interface around the tail, grep, awk and sed
  149. commands, displaying the results via a web interface.")
  150. (license license:bsd-3)))
  151. (define-public multitail
  152. (package
  153. (name "multitail")
  154. (version "6.5.0")
  155. (source
  156. (origin
  157. (method url-fetch)
  158. (uri (string-append "https://vanheusden.com/multitail/multitail-"
  159. version ".tgz"))
  160. (sha256
  161. (base32 "1vd9vdxyxsccl64ilx542ya5vlw2bpg6gnkq1x8cfqy6vxvmx7dj"))))
  162. (build-system gnu-build-system)
  163. (arguments
  164. `(#:make-flags
  165. (list (string-append "CC=" ,(cc-for-target))
  166. (string-append "PREFIX="
  167. (assoc-ref %outputs "out")))
  168. #:phases
  169. (modify-phases %standard-phases
  170. (add-after 'unpack 'patch-curses-lib
  171. (lambda* (#:key outputs #:allow-other-keys)
  172. (let ((out (assoc-ref outputs "out")))
  173. (substitute* "mt.h"
  174. (("ncursesw\\/panel.h") "panel.h")
  175. (("ncursesw\\/ncurses.h") "ncurses.h")))
  176. #t))
  177. (delete 'configure)) ; no configure script
  178. #:tests? #f)) ; no test suite (make check just runs cppcheck)
  179. (inputs (list ncurses))
  180. (home-page "https://vanheusden.com/multitail/")
  181. (synopsis "Monitor multiple log files")
  182. (description
  183. "MultiTail can monitor, color, filter, and merge log files and command
  184. output in multiple windows in a terminal.")
  185. (license license:gpl2+)))
  186. (define-public spdlog
  187. (package
  188. (name "spdlog")
  189. (version "1.9.2")
  190. (source
  191. (origin
  192. (method git-fetch)
  193. (uri (git-reference
  194. (url "https://github.com/gabime/spdlog")
  195. (commit (string-append "v" version))))
  196. (file-name (git-file-name name version))
  197. (sha256
  198. (base32 "1img03ka63hf3sb62v5f02ax5jc9mlpz5cijr38xxzymvcg1s98r"))))
  199. (build-system cmake-build-system)
  200. ;; TODO run benchmark. Currently not possible, as adding
  201. ;; (gnu packages benchmark) forms a dependency cycle
  202. (arguments
  203. '(#:configure-flags
  204. (list "-DSPDLOG_BUILD_BENCH=OFF"
  205. "-DSPDLOG_BUILD_SHARED=ON"
  206. "-DSPDLOG_BUILD_TESTS=ON")))
  207. (home-page "https://github.com/gabime/spdlog")
  208. (synopsis "Fast C++ logging library")
  209. (description "Spdlog is a very fast header-only/compiled C++ logging
  210. library.")
  211. ;; spdlog is under Expat license, but the bundled fmt library in
  212. ;; "include/spdlog/fmt/bundled" is under BSD 2 clause license.
  213. (license (list license:expat license:bsd-2))))
  214. (define-public rsyslog
  215. (package
  216. (name "rsyslog")
  217. (version "8.2112.0")
  218. (source
  219. (origin
  220. (method git-fetch)
  221. (uri (git-reference
  222. (url "https://github.com/rsyslog/rsyslog.git")
  223. (commit (string-append "v" version))))
  224. (file-name (git-file-name name version))
  225. (sha256
  226. (base32
  227. "0bp124w2qv8hix5i0p04d8yvsipy18dhqm7zw8i6cwdgnhdadq96"))))
  228. (build-system gnu-build-system)
  229. (arguments
  230. (list
  231. #:phases
  232. '(modify-phases %standard-phases
  233. ;; autogen.sh calls configure at the end of the script.
  234. (replace 'bootstrap
  235. (lambda _ (invoke "autoreconf" "-vfi"))))
  236. #:configure-flags
  237. ;; Rsyslog comes with a plethora of optional modules. We enable most of
  238. ;; them for a full-featured build.
  239. '(list "--enable-kmsg"
  240. "--enable-liblogging_stdlog"
  241. "--enable-mmanon"
  242. "--enable-mmcount"
  243. "--enable-unlimited_select"
  244. ;; Input plugins
  245. "--enable-imbatchreport"
  246. "--enable-imczmq"
  247. "--enable-imdiag" ;for full tests
  248. "--enable-imdocker"
  249. "--enable-imfile"
  250. "--enable-imkafka"
  251. "--enable-improg"
  252. "--enable-impstats"
  253. "--enable-imptcp"
  254. "--enable-imtuxedoulog"
  255. ;; Output plugins
  256. "--enable-clickhouse"
  257. "--enable-elasticsearch"
  258. "--enable-mail"
  259. "--enable-omczmq"
  260. "--enable-omfile_hardened"
  261. "--enable-omhttp"
  262. "--enable-omhttpfs"
  263. "--enable-omkafka"
  264. "--enable-omprog"
  265. "--enable-omruleset"
  266. "--enable-omstdout"
  267. "--enable-omtcl"
  268. "--enable-omudpspoof"
  269. "--enable-omuxsock"
  270. ;; Parser Modules
  271. "--enable-pmaixforwardedfrom"
  272. "--enable-pmciscoios"
  273. "--enable-pmcisconames"
  274. "--enable-pmdb2diag"
  275. "--enable-pmlastmsg"
  276. "--enable-pmnormalize"
  277. "--enable-pmnull"
  278. "--enable-pmpanngfw"
  279. "--enable-pmsnare"
  280. ;; Message Modification Modules
  281. "--enable-mmaudit"
  282. "--enable-mmdarwin"
  283. "--enable-mmdblookup"
  284. "--enable-mmfields"
  285. "--enable-mmjsonparse"
  286. "--enable-mmkubernetes"
  287. "--enable-mmnormalize"
  288. "--enable-mmpstrucdata"
  289. "--enable-mmrfc5424addhmac"
  290. "--enable-mmrm1stspace"
  291. "--enable-mmsequence"
  292. "--enable-mmsnmptrapd"
  293. "--enable-mmtaghostname"
  294. "--enable-mmutf8fix"
  295. ;; Database Support
  296. "--enable-libdbi"
  297. "--enable-mysql"
  298. "--enable-pgsql"
  299. ;; Protocol Support
  300. "--enable-openssl"
  301. "--enable-gnutls"
  302. "--enable-gssapi-krb5"
  303. "--enable-snmp"
  304. ;; Function modules
  305. "--enable-fmhash_xxhash")))
  306. (native-inputs
  307. (list autoconf automake bison flex libtool pkg-config))
  308. (inputs
  309. (list curl
  310. cyrus-sasl
  311. czmq
  312. gnutls
  313. libdbi
  314. libestr
  315. libfastjson
  316. libgcrypt
  317. liblogging
  318. liblognorm
  319. libmaxminddb
  320. libnet
  321. librdkafka
  322. lz4
  323. (list mariadb "dev")
  324. (list mariadb "lib")
  325. mit-krb5
  326. net-snmp
  327. openssl
  328. postgresql
  329. tcl
  330. (list util-linux "lib")
  331. zeromq
  332. zlib))
  333. (home-page "https://www.rsyslog.com/")
  334. (synopsis "RSYSLOG is a flexible and fast system for log processing")
  335. (description
  336. "Rsyslog offers high-performance, great security features and a modular
  337. design. While it started as a regular syslogd, rsyslog has evolved into a
  338. kind of swiss army knife of logging, being able to accept inputs from a wide
  339. variety of sources, transform them, and output the results to diverse
  340. destinations.")
  341. ;; Most of the source code is licensed under the LGPL3+ with many source
  342. ;; files licensed under the terms of the ASL2.0. Some modules are
  343. ;; licensed under GPL3+.
  344. (license (list license:lgpl3+
  345. license:gpl3+
  346. license:asl2.0))))