98 LogServer( std::shared_ptr<DebugStream> log );
99 LogServer( std::shared_ptr<LogAgregator> log );
102 void setCmdTimeout( timeout_t msec )
noexcept;
103 void setSessionLog( Debug::type t )
noexcept;
104 void setMaxSessionCount(
size_t num )
noexcept;
107 bool async_run(
const std::string& addr,
int port );
108 bool run(
const std::string& addr,
int port );
112 bool isRunning()
const noexcept;
114 bool check(
bool restart_if_fail =
true );
116 void init(
const std::string& prefix, xmlNode* cnode =
nullptr,
int argc = 0,
const char*
const argv[] =
nullptr );
118 static std::string help_print(
const std::string& prefix );
120 std::string getShortInfo();
122#ifndef DISABLE_REST_API
123 Poco::JSON::Object::Ptr httpGetShortInfo();
124 static Poco::JSON::Object::Ptr httpLogServerInfo(
const std::shared_ptr<LogServer>& logserv,
125 const std::string& host,
132 virtual void evprepare(
const ev::loop_ref& loop )
override;
133 virtual void evfinish(
const ev::loop_ref& loop )
override;
134 virtual std::string wname()
const noexcept override;
136 void ioAccept( ev::io& watcher,
int revents );
138 void saveDefaultLogLevels(
const std::string& logname );
139 void restoreDefaultLogLevels(
const std::string& logname );
140 std::string onCommand(
LogSession* s, LogServerTypes::Command cmd,
const std::string& logname );
144 timeout_t cmdTimeout = { 2000 };
145 Debug::type sessLogLevel = { Debug::NONE };
146 size_t sessMaxCount = { 10 };
148 typedef std::vector< std::shared_ptr<LogSession> > SessionList;
158 std::shared_ptr<UTCPSocket> sock;
159 std::shared_ptr<DebugStream> elog;
165 std::unordered_map< DebugStream*, Debug::type > defaultLogLevels;
167 std::string myname = {
"LogServer" };
168 std::string addr = {
"" };
169 Poco::UInt16 port = { 0 };
171 std::atomic_bool isrunning = {
false };