BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
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 namespace fc
8 {
9  // Log appender that sends log messages in JSON format over UDP
10  // https://www.graylog2.org/resources/gelf/specification
11  class gelf_appender : public appender
12  {
13  public:
14  struct config
15  {
16  string endpoint = "127.0.0.1:12201";
17  string host = "fc"; // the name of the host, source or application that sent this message (just passed through to GELF server)
19  };
20 
21  gelf_appender(const variant& args);
23  virtual void log(const log_message& m) override;
24 
25  private:
26  class impl;
27  std::unique_ptr<impl> my;
28  };
29 } // namespace fc
30 
31 #include <fc/reflect/reflect.hpp>
33  (endpoint)(host)(max_object_depth))
appender.hpp
fc::gelf_appender::~gelf_appender
~gelf_appender()
Definition: gelf_appender.cpp:84
fc
Definition: api.hpp:15
fc::appender
Definition: appender.hpp:28
FC_MAX_LOG_OBJECT_DEPTH
#define FC_MAX_LOG_OBJECT_DEPTH
Definition: config.hpp:8
reflect.hpp
Defines types and macros used to provide reflection.
fc::asio::tcp::endpoint
boost::asio::ip::tcp::endpoint endpoint
Definition: asio.hpp:239
fc::gelf_appender::config::max_object_depth
uint32_t max_object_depth
Definition: gelf_appender.hpp:18
fc::gelf_appender::config::host
string host
Definition: gelf_appender.hpp:17
fc::gelf_appender
Definition: gelf_appender.hpp:11
fc::gelf_appender::config::endpoint
string endpoint
Definition: gelf_appender.hpp:16
fc::gelf_appender::gelf_appender
gelf_appender(const variant &args)
Definition: gelf_appender.cpp:40
fc::gelf_appender::log
virtual void log(const log_message &m) override
Definition: gelf_appender.cpp:87
fc::log_message
aggregates a message along with the context and associated meta-information.
Definition: log_message.hpp:106
fc::gelf_appender::config
Definition: gelf_appender.hpp:14
fc::variant
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
Definition: variant.hpp:198
logger.hpp
FC_REFLECT
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition: reflect.hpp:388
time.hpp
fc::gelf_appender::impl
Definition: gelf_appender.cpp:23