Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
gelf_appender.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <fc/log/appender.hpp>
4#include <fc/log/logger.hpp>
5#include <fc/time.hpp>
6
7#include <regex>
8
9namespace fc
10{
11 // Log appender that sends log messages in JSON format over UDP
12 // https://www.graylog2.org/resources/gelf/specification
13 class gelf_appender final : public appender
14 {
15 public:
16 struct config
17 {
18 static const std::vector<std::string> reserved_field_names;
19 static const std::regex user_field_name_pattern;
20 string endpoint = "127.0.0.1:12201";
21 string host = "fc"; // the name of the host, source or application that sent this message (just passed through to GELF server)
23 };
24
25 gelf_appender(const variant& args);
34 void initialize(boost::asio::io_service& io_service) override;
35 virtual void log(const log_message& m) override;
36
37 private:
38 class impl;
39 std::shared_ptr<impl> my;
40 };
41} // namespace fc
42
45 (endpoint)(host)(user_fields))
virtual void log(const log_message &m) override
gelf_appender(const variant &args)
void initialize(boost::asio::io_service &io_service) override
Required for name resolution and socket initialization.
aggregates a message along with the context and associated meta-information.
An order-preserving dictionary of variants.
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Definition variant.hpp:191
namespace sysio::chain
Definition authority.cpp:3
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition reflect.hpp:311
static const std::regex user_field_name_pattern
static const std::vector< std::string > reserved_field_names