mirror of
https://github.com/lumapu/ahoy.git
synced 2025-06-12 15:41:38 +02:00
Enhancement: log to syslog server instead of web-serial
This commit is contained in:
parent
69cdacaac7
commit
21848bd5ae
3 changed files with 16 additions and 0 deletions
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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…
Add table
Add a link
Reference in a new issue