BitShares-Core  5.0.0
BitShares blockchain implementation and command-line interface 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>
virtual void log(const log_message &m) override
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
Definition: reflect.hpp:386
Defines types and macros used to provide reflection.
#define FC_MAX_LOG_OBJECT_DEPTH
Definition: config.hpp:8
gelf_appender(const variant &args)
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object&#39;s.
Definition: variant.hpp:198
aggregates a message along with the context and associated meta-information.
Definition: api.hpp:15