graylog-logger | writing log messages to console , file and Graylog server
kandi X-RAY | graylog-logger Summary
kandi X-RAY | graylog-logger Summary
This is a simple logging library which can be used to send log messages to a Graylog server. This is done by creating messages in the GELF format and sending them to a Graylog server via TCP. For testing purposes a Vagrant machine running Graylog can be used. A simple Vagrantfile for creating this set-up can be found here. The argument for creating yet another logging library instead of writing a plugin/sink/handler for an already existing one is that a relatively light weight solution was desired. The library has functionality for writing log messages to console and file as well. By default the library will only write log messages to console.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of graylog-logger
graylog-logger Key Features
graylog-logger Examples and Code Snippets
Community Discussions
Trending Discussions on graylog-logger
QUESTION
I am using a C++ logging library on a FreeBSD 10 machine and I am running into trouble closing threads when receiving a sigint
.
A created a GitHub project for testing purposes (link). If you build it on FreeBSD 10, execute it and press [ctrl+c] it will terminate. You can find the build commands I use below.
...ANSWER
Answered 2017-May-31 at 06:06That's not a bug, that's a feature.
You don't get a guarantee about where your signal is going to be delivered, and the set of things you're allowed to do in a signal handler is restricted.
See sigaction(3)
for details about what you can do (and you can't do anything else). Your program is doing many things that are not allowed in a signal handler.
The correct thing to do is to signal something else in your program and return from the signal handler. An example technique for doing that is the "self pipe trick". Create a pipe and keep a handle to both ends. Read from one end in your normal I/O processing. If you get a signal, in the signal handler, write a byte to the other end of the pipe and return. When the byte is read from the pipe you know the signal has arrived and you can do extended processing safely.
Update:
As Michael Burr has pointed out, you can block particular threads from receiving particular signals using pthread_sigmask(3)
. However, to fix the underlying problem here you still need to not do the work in the signal handler.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install graylog-logger
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page