{"action":"created","issue":{"url":"https://api.github.com/repos/easylogging/easyloggingpp/issues/422","repository_url":"https://api.github.com/repos/easylogging/easyloggingpp","labels_url":"https://api.github.com/repos/easylogging/easyloggingpp/issues/422/labels{/name}","comments_url":"https://api.github.com/repos/easylogging/easyloggingpp/issues/422/comments","events_url":"https://api.github.com/repos/easylogging/easyloggingpp/issues/422/events","html_url":"https://github.com/easylogging/easyloggingpp/issues/422","id":191558793,"number":422,"title":"How to use loggerID?","user":{"login":"mga0","id":16271397,"avatar_url":"https://avatars.githubusercontent.com/u/16271397?v=3","gravatar_id":"","url":"https://api.github.com/users/mga0","html_url":"https://github.com/mga0","followers_url":"https://api.github.com/users/mga0/followers","following_url":"https://api.github.com/users/mga0/following{/other_user}","gists_url":"https://api.github.com/users/mga0/gists{/gist_id}","starred_url":"https://api.github.com/users/mga0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mga0/subscriptions","organizations_url":"https://api.github.com/users/mga0/orgs","repos_url":"https://api.github.com/users/mga0/repos","events_url":"https://api.github.com/users/mga0/events{/privacy}","received_events_url":"https://api.github.com/users/mga0/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-24T16:26:52Z","updated_at":"2016-11-30T14:25:56Z","closed_at":null,"body":"Hello together, \r\nfrom the readme file I try desperately to extract how to get the loggerID to work. I want to write measurements to a discrete file and I think, loggerID is the thing which will help me. But I don't get it to work from the configuration file and the readme talks about this topic in a few lines only.\r\n\r\nWhat I tried was \r\n\r\n```\r\n -- loggerID\r\n  * GLOBAL:\r\n       FORMAT               =  \"%datetime %msg\"\r\n       FILENAME             =  \"logs/%datetime{%Y%M%d\r\n ...\r\n```\r\n\r\nand\r\n\r\n```\r\n* GLOBAL:\r\n-- loggerID\r\n       FORMAT               =  \"%datetime %msg\"\r\n       FILENAME             =  \"logs/%datetime{%Y%M%d\r\n ...\r\n```\r\n\r\nUsing this code:\r\n```\r\nel::Configurations conf(\"C:/Users/<absolutePath>/logging.conf\");\r\nel::Loggers::addFlag(el::LoggingFlag::FixedTimeFormat);\r\nel::Loggers::addFlag(el::LoggingFlag::AutoSpacing);\r\nel::Loggers::addFlag(el::LoggingFlag::ImmediateFlush);\r\nel::Loggers::reconfigureAllLoggers(conf);\r\nel::Loggers::setDefaultConfigurations(conf, false);\r\nel::Logger* l = el::Loggers::getLogger(\"loggerID\");\r\nl->info(\"test\");\r\nCLOG(INFO, \"loggerID\") << \"test2\"; \r\n```\r\nBut the startup of the project gives this failures: \r\n\r\n> ASSERTION FAILURE FROM EASYLOGGING++ (LINE: 2831) [*currLevel != Level::Unknown] WITH MESSAGE \"Unrecognized severity level []\"\r\nASSERTION FAILURE FROM EASYLOGGING++ (LINE: 2832) [currConfig != ConfigurationType::Unknown] WITH MESSAGE \"Unrecognized configuration []\"\r\nASSERTION FAILURE FROM EASYLOGGING++ (LINE: 2716) [parsedSuccessfully] WITH MESSAGE \"Unable to parse configuration line: -- loggerID\"\r\n\r\nAnd the test strings are landing in the standard info_log location. \r\nHow to use loggerID correctly what lets the parse error disappear?\r\nThanks a lot!\r\n"},"comment":{"url":"https://api.github.com/repos/easylogging/easyloggingpp/issues/comments/263885993","html_url":"https://github.com/easylogging/easyloggingpp/issues/422#issuecomment-263885993","issue_url":"https://api.github.com/repos/easylogging/easyloggingpp/issues/422","id":263885993,"user":{"login":"mga0","id":16271397,"avatar_url":"https://avatars.githubusercontent.com/u/16271397?v=3","gravatar_id":"","url":"https://api.github.com/users/mga0","html_url":"https://github.com/mga0","followers_url":"https://api.github.com/users/mga0/followers","following_url":"https://api.github.com/users/mga0/following{/other_user}","gists_url":"https://api.github.com/users/mga0/gists{/gist_id}","starred_url":"https://api.github.com/users/mga0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mga0/subscriptions","organizations_url":"https://api.github.com/users/mga0/orgs","repos_url":"https://api.github.com/users/mga0/repos","events_url":"https://api.github.com/users/mga0/events{/privacy}","received_events_url":"https://api.github.com/users/mga0/received_events","type":"User","site_admin":false},"created_at":"2016-11-30T14:25:56Z","updated_at":"2016-11-30T14:25:56Z","body":"Okay, no I haven't seen this. Thanks, this makes it clearer. Can could you please add a link into the readme.md section, to make the loggerID functionality clearer?\r\nI haven't set `el::LoggingFlag::MultiLoggerSupport`-flag and read the config file before setting the flags. Maybe this changed something. \r\n\r\nBut anyhow, I still get can parsing error when reading the global.conf.\r\nMy **global.conf** looks like\r\n```-- default\r\n\t*GLOBAL:\r\n\t   FORMAT               =  \"%datetime %msg\"\r\n\t   FILENAME             =  \"logs/%datetime{%Y%M%d_%H%m%s}_log_global.log\"\r\n\t   ENABLED              =  true\r\n\t   TO_FILE              =  true\r\n\t   TO_STANDARD_OUTPUT   =  true\r\n\t   MILLISECONDS_WIDTH   =  1\r\n\t   PERFORMANCE_TRACKING =  true\r\n\t   MAX_LOG_FILE_SIZE    =  2097152 ## 2MB - Comment starts with two hashes (##)\r\n\t   LOG_FLUSH_THRESHOLD  =  100 ## Flush after every 100 logs\r\n\t*DEBUG:\r\n\t   FORMAT               = \"%datetime{%Y.%M.%d %H:%m:%s:%g} %func %msg\"\r\n\t   FILENAME             = \"logs/%datetime{%Y%M%d_%H%m%s}_log_debug.log\"\r\n-- loggerID\r\n   *INFO:\r\n      FORMAT               = \"%datetime{%Y.%M.%d %H:%m:%s:%g} %msg %msg\" ## write twice to see a difference to loggerID2\r\n      FILENAME             = \"logs/%datetime{%Y%M%d_%H%m%s}_log_logger1_info.log\" \r\n-- loggerID2\r\n\t*INFO:\r\n\t\tFORMAT               = \"%datetime{%Y.%M.%d %H:%m:%s:%g} %msg\" ## write twice to see difference\r\n\t\tFILENAME             = \"logs/%datetime{%Y%M%d_%H%m%s}_log_logger2_info.log\"\r\n```\r\nand the code which runs is:\r\n\r\n**main.cpp**\r\n```\r\n#include \"SomeClass.hpp\"\r\n#include \"easyloggingpp\\src\\easylogging++.h\"\r\n\r\n#include <conio.h>\r\n\r\nINITIALIZE_EASYLOGGINGPP\r\n\r\nusing namespace std;\r\n\r\nint main(int argc, char **argv)\r\n{\r\n\tSTART_EASYLOGGINGPP(argc, argv);\r\n\tSomeClass sc = SomeClass()\r\n}\r\n```\r\n**SomeClass.cpp**\r\n```\r\n#define _ELPP_THREAD_SAFE\r\n#include \"SomeClass.hpp\"\r\n\r\nSomeClass::SomeClass()\r\n{\r\n        el::Loggers::addFlag(el::LoggingFlag::MultiLoggerSupport);\r\n\tel::Loggers::addFlag(el::LoggingFlag::FixedTimeFormat);\r\n\tel::Loggers::addFlag(el::LoggingFlag::AutoSpacing);\r\n\tel::Loggers::addFlag(el::LoggingFlag::ImmediateFlush);\r\n\tel::Configurations conf(\"<path>/global.conf\");\r\n\r\n\tel::Loggers::reconfigureAllLoggers(conf);\r\n\tel::Loggers::setDefaultConfigurations(conf, false);\r\n\tel::Logger* l = el::Loggers::getLogger(\"loggerID\");\r\n\tel::Logger* l2 = el::Loggers::getLogger(\"loggerID2\");\r\n\r\n\tCLOG(INFO, \"loggerID\") << \"test\";\r\n\tCLOG(INFO, \"loggerID2\") << \"test2\";\r\n\tCLOG(INFO, \"loggerID\") << \"test\";\r\n}\r\n```\r\nBut still during running the test class, I get this message out:\r\n\r\n> ASSERTION FAILURE FROM EASYLOGGING++ (LINE: 2831) [*currLevel != Level::Unknown] WITH MESSAGE \"Unrecognized severity level []\"\r\nASSERTION FAILURE FROM EASYLOGGING++ (LINE: 2832) [currConfig != ConfigurationType::Unknown] WITH MESSAGE \"Unrecognized configuration []\"\r\nASSERTION FAILURE FROM EASYLOGGING++ (LINE: 2716) [parsedSuccessfully] WITH MESSAGE \"Unable to parse configuration line: -- default\"\r\nASSERTION FAILURE FROM EASYLOGGING++ (LINE: 2832) [currConfig != ConfigurationType::Unknown] WITH MESSAGE \"Unrecognized configuration [FILENAME]\"\r\nASSERTION FAILURE FROM EASYLOGGING++ (LINE: 2716) [parsedSuccessfully] WITH MESSAGE \"Unable to parse configuration line: -- loggerID\"\r\nASSERTION FAILURE FROM EASYLOGGING++ (LINE: 2832) [currConfig != ConfigurationType::Unknown] WITH MESSAGE \"Unrecognized configuration [FILENAME]\"\r\nASSERTION FAILURE FROM EASYLOGGING++ (LINE: 2716) [parsedSuccessfully] WITH MESSAGE \"Unable to parse configuration line: -- loggerID2\"\r\n\r\nAnd all the messages go into the last defined location **20161130_231728_log_logger2_info.log** to the last defined format:\r\n>2016.11.30 19:40:21:1 test  \r\n2016.11.30 19:40:21:2 test2\r\n2016.11.30 19:40:21:2 test\r\n \r\nHave you an idea why the config is not read into two separate configurations? Thanks for your time in advance!\r\n"}}
{"actor":{"display_login":"mga0"}}