I just started playing with it with ApacheKafka. I set the whole thing up and now I am trying to introduce Kafka sending logs via log appender in already existing Java application. This application is using Logback as a logger library. So, I guess, that makes me impossible to use kafka.producer.KafkaLog4jAppender? There are not compatible? I am getting IncompatibleClassException. Is there maybe other solution? Thanks a lot!!
You can use logback-kafka appender available.
Check this link
This is a good Logback Appender that sends log messages to Kafka. It has a powerful, light-weight approach that allows you to make full use of the latest Kafka Producer.
Related
Is it possible to transfer the AEM (v5.6) logs to the Log4j server? Or there is some best practice for centralized AEM logging?
I haven't dealt much with AEM. It seems the Apache Sling Logging services configure only the FileAppender.
For CQ5.5 there is no log4j.xml. All the CRX logger needs to
configured using sling config.
We can use Apache Sling Logging Logger
Configuration
(https://docs.adobe.com/docs/en/aem/6-0/deploy/configuring/monitoring-and-maintaining.html#Create%20a%20Custom%20Log%20File)
or LogBack
(http://sling.apache.org/documentation/development/logging.html#logback-integration)
AEM provides the loggers out of the box as you have seen. Typically if you want centrallized log handling I would suggest mounting a super-high-speed shared volume and having all instances log there, just for performance/speed reasons.
You might want to check out this:
http://adobe-consulting-services.github.io/acs-aem-commons/features/syslog-appender.html
It is AEM6 only, but you could look at the code and do it that way.
This uses logback, not log4j, but it should solve your problem.
The other option, really, is to write your own logging service and use that and configure the appender in the code. I do not see the normal XML files anywhere. I'm curious if you come across them.
Let me know if I can help further.
I have logging working to Sentry from android just using the EventBuilder from raven-java, but I need to attach extra info which apparently EventBuilder or java.util.logging can't do.
I tried to use log4j but it doesn't pick up log4j.properties, how can I configure it with the Sentry DSN and other information? I have no preference about what logging library to use, so logback or log4j2 will do but they seem to suffer from the same problems.
I tried to configure logging programmatically but can't add the appender SentryAppender.
I also tried using android-logging-log4j library but this has the same problem.
I realize that https://github.com/joshdholtz/Sentry-Android exists which might work but it doesn't do retries in case of network issues which is quite important.
The https://github.com/joshdholtz/Sentry-Android library now supports saving of offline captures and failed captures as of version v1.1.0 - https://github.com/joshdholtz/Sentry-Android/releases/tag/v1.1.0
I am using zookeeper successfully. It keeps printing status updates and warnings to the shell, which is actually making it harder to debug my program (which is not working as well as zookeeper). Is there an easy way to turn that off in zookeeper without going into the source? Or is there a way to run a java program so that only the executing program gets to print to the shell?
Isn't 'logging' chapter of Zookeeper administrator's guide what you actually want?
ZooKeeper uses log4j so it is pretty standard logging approach with lot of configuration flexibility available.
By default zookeeper emits INFO or higher severity level messages and it uses log4j for logging. So define logging level to a higher severity in your log4j.properties (assuming you provided the path to the .properties or it's in the working directory)
there is a similar post on avoiding ZooKeeper log messages - like this:
zoo_set_log_stream(fopen("NULL", "w"));
This will turn of all output from ZooKeeper
I just read the gwt-log Getting Started guide and found it very helpful, however I have a few questions surrounding the Loggers:
The SystemLogger sends output to System.err and System.out - in the context of a client-side web app running inside a browser, where will this output eventually go? Browser logs?
Does RemoteLogger depend on JUL or log4j? I have a homegrown slf4j binding that I like to use for all my Java backends, and would like to use it, but not sure if RemoteLogger will be incompatible with it?
Is it possible to have RemoteLogger hit my own LoggingServiceServlet, which could then translate the log messages coming in on the HttpServletRequest into logging statements that are compatible with my custom slf4j binding? If so, what might this config look like?
Thanks in advance!
In this link, you have a most updated documentation about the GWT logging framework
Answers to your questions:
#1 Yes it works in client side, but only when running the app in DevMode (not in production nor superdev mode). Look for the log lines in the DevMode window, or in your terminal output if you run dev-mode from the command-line.
#2 It depends on java.util.logging, you can change it though (see #3)
#3 Yes you can change the logging framework extending the RemoteLoggingServiceImpl and overriding the logOnServer(LogRecord lr) method.
I'm looking for a logging solution that is based on SLF4J so I can bind to any underlying implementation I want at runtime (for right now I'm thinking log4j). Since I am planning to have my backend routed via Apache Camel, I figured Camel must have some solution for logging.
It does - here.
But from that page description I can't tell if camel-log is for pushing internal (Camel) messages (errors, exceptions, infos, etc.) to SLF4J, or for me to use as a SLF4J "wrapper", or both.
Hence my question: is camel-log for enabling Camel messaging (so I can see what Camel is doing under the hood) or is it a component that pushes my application's messages onto a route? Or both?!?
Thanks in advance!
Camel log component (http://camel.apache.org/log.html) is for logging exchanges. In latest versions of Camel it uses SFL4J so you could choose underlying logging implementation in usual SFL4J way.
You could enable 'trace' on Camel context to 'see what Camel is doing under the roof'.
For your own logging you could just use SLF4J inside your code as usual.