logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Remko Popma (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-1537) Experience of a newbie to logging
Date Sun, 21 Aug 2016 00:05:20 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-1537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15429540#comment-15429540
] 

Remko Popma commented on LOG4J2-1537:
-------------------------------------

I'm fine with answering questions on Jira as well as the mailing list.

*Quick Introduction to Logging*
* In your code: use the [logging API|https://logging.apache.org/log4j/2.x/manual/api.html]
* Control what log4j will do with the logging [configuration|https://logging.apache.org/log4j/2.x/manual/configuration.html]

If you are new to logging I recommend starting with one of the many configuration examples
in the manual. Most of these are XML, so start by copying one of these into a file named {{log4j2.xml}}
and put that in your classpath. When you have something working make some changes to the configuration,
like add an appender or a lookup. Once you are comfortable with how the configuration works,
you can experiment with other formats like YAML. You are free to do things differently but
I think this is the quickest and easiest way to learn.

[This tutorial|http://www.journaldev.com/7128/log4j2-example-tutorial-configuration-levels-appenders]
may also be useful.

> Experience of a newbie to logging
> ---------------------------------
>
>                 Key: LOG4J2-1537
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1537
>             Project: Log4j 2
>          Issue Type: Improvement
>         Environment: idea 2016, maven
>            Reporter: d
>            Priority: Minor
>              Labels: feedback
>
> Not sure if this is the right place for general feedback but here goes:
> I wanted to learn to use loggers, googling told me log4j2 was popular so I had a go with
it. I feel the documentation is extremely lacking / poorly organized for a first timer - I've
used java for a few years but never loggers. 
> One problem that completely stopped me getting anywhere - I cannot get log4j2 to access
the configuration file. I can access the classpath and properties file myself fine but log4j
refuses to find it. I'm using the latest intellij idea with maven. Here is some more info:
http://pastebin.com/7Nix7zME
> I think for now I will abandon trying to use log4j, it doesn't feel logger-newbie friendly
:(



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message