97 LogServer( std::shared_ptr<DebugStream> log );
98 LogServer( std::shared_ptr<LogAgregator> log );
101 void setCmdTimeout( timeout_t msec )
noexcept;
102 void setSessionLog( Debug::type t )
noexcept;
103 void setMaxSessionCount(
size_t num )
noexcept;
105 bool async_run(
const std::string& addr, Poco::UInt16 port );
106 bool run(
const std::string& addr, Poco::UInt16 port );
110 bool isRunning()
const noexcept;
112 bool check(
bool restart_if_fail =
true );
114 void init(
const std::string& prefix, xmlNode* cnode = 0 );
116 static std::string help_print(
const std::string& prefix );
118 std::string getShortInfo();
120#ifndef DISABLE_REST_API
121 Poco::JSON::Object::Ptr httpGetShortInfo();
127 virtual void evprepare(
const ev::loop_ref& loop )
override;
128 virtual void evfinish(
const ev::loop_ref& loop )
override;
129 virtual std::string wname()
const noexcept override;
131 void ioAccept( ev::io& watcher,
int revents );
133 void saveDefaultLogLevels(
const std::string& logname );
134 void restoreDefaultLogLevels(
const std::string& logname );
135 std::string onCommand(
LogSession* s, LogServerTypes::Command cmd,
const std::string& logname );
139 timeout_t cmdTimeout = { 2000 };
140 Debug::type sessLogLevel = { Debug::NONE };
141 size_t sessMaxCount = { 10 };
143 typedef std::vector< std::shared_ptr<LogSession> > SessionList;
153 std::shared_ptr<UTCPSocket> sock;
154 std::shared_ptr<DebugStream> elog;
160 std::unordered_map< DebugStream*, Debug::type > defaultLogLevels;
162 std::string myname = {
"LogServer" };
163 std::string addr = {
"" };
164 Poco::UInt16 port = { 0 };
166 std::atomic_bool isrunning = {
false };