Hello
I'm new to splunk and also to Java (sorry). I'm trying to write simple app to log events to Splunk using HTTP Event collector. However, I have managet to get Log4j 2 working to log to files, I cannot get it to log to HTTP.
Log4j2 is complaining that HTTP appender return null - which is true as there is no such support (closest is Socket Appender).
I'm using NetBeans for developer.
Can anyone send me short example (including log4j2.xml) how to actually get it working.
I clearly see in the questions that it is being used, but I have spent numerous hours without any success.
I have followed instructions in the splunk install website - there are actually just 2 lines to be added, but it is not working. Instructions are simply 3 lines so it feels super simple, but it is not working.
e.g.
Logger logger = org.apache.logging.log4j.core.LoggerContext.getLogger(loggerName);
gives me an error as LoggerContext does not contain method getLogger.
Examples provided in Splunk logging resources folder are too complex for me and I cannot get my head around it.
I have used instructions on http://dev.splunk.com/view/splunk-logging-java/SP-CAAAE7M
I think biggest problem I'm facing is that HTTP appender is not recognized by Log4j which suggests that I should initialize logger somehow differently, but have no clue how.
Please help
Thanks a lot
↧