Browse Source

Enhancement: log to syslog server instead of web-serial

pull/1299/head^2
Frank 1 year ago
parent
commit
21848bd5ae
  1. 3
      src/app.cpp
  2. 4
      src/app.h
  3. 9
      src/config/config_override_example.h

3
src/app.cpp

@ -82,6 +82,9 @@ void app::setup() {
mApi.setup(this, &mSys, mWeb.getWebSrvPtr(), mConfig);
#ifdef ENABLE_SYSLOG
mDbgSyslog.setup(mConfig); // be sure to init after mWeb.setup (webSerial uses also debug callback)
#endif
// Plugins
#if defined(PLUGIN_DISPLAY)
if (mConfig->plugin.display.type != 0)

4
src/app.h

@ -22,6 +22,7 @@
#include "utils/crc.h"
#include "utils/dbg.h"
#include "utils/scheduler.h"
#include "utils/syslog.h"
#include "web/RestApi.h"
#include "web/web.h"
#include "hm/Communication.h"
@ -311,6 +312,9 @@ class app : public IApp, public ah::Scheduler {
#endif /* defined(ETHERNET) */
WebType mWeb;
RestApiType mApi;
#ifdef ENABLE_SYSLOG
DbgSyslog mDbgSyslog;
#endif
//PayloadType mPayload;
//MiPayloadType mMiPayload;
PubSerialType mPubSerial;

9
src/config/config_override_example.h

@ -35,4 +35,13 @@
// #define ENABLE_PROMETHEUS_EP
// to enable the syslog logging (will disable web-serial)
//#define ENABLE_SYSLOG
#ifdef ENABLE_SYSLOG
#define SYSLOG_HOST "<hostname-or-ip-address-of-syslog-server>"
#define SYSLOG_APP "ahoy"
#define SYSLOG_FACILITY FAC_USER
#define SYSLOG_PORT 514
#endif
#endif /*__CONFIG_OVERRIDE_H__*/

Loading…
Cancel
Save