[
https://issues.jboss.org/browse/FORGE-2318?page=com.atlassian.jira.plugin...
]
Antonio Goncalves updated FORGE-2318:
-------------------------------------
Description:
It would be good to have a few commands to setup a logger and inject it into bean. And
because logs are a pain (too many frameworks) it would help to have a {{logger-setup}}
command. It will create the needed dependency (in the {{pom.xml}}) and add some basic
configuration (eg. {{logback.xml}}) and why not, create a producer method so it can be
injected.
A basic logger would use JUL :
{code}
logger-setup
{code}
Or we could choose a provider and a version
{code}
logger-setup --provider LOG4J --version 4.1
{code}
The different logging frameworks are :
* JUL (out of the box, no need to have a dependency)
* LOG4J2 :
http://logging.apache.org/log4j/2.x/
* LOG4J1 :
http://logging.apache.org/log4j/2.x/manual/migration.html
* SLF4J :
http://www.slf4j.org/
* COMMONS_LOGGING :
http://commons.apache.org/proper/commons-logging/
* LOGBACK :
http://logback.qos.ch/
Setting up a logger would add the right dependency but also generate a producer that would
look like that, and therefore could be injected :
{code}
public class LoggingProducer {
@Produces
public Logger produceLogger(InjectionPoint injectionPoint) {
return
Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName());
}
}
{code}
was:
It would be good to have a few commands to setup a logger and inject it into bean. And
because logs are a pain (too many frameworks) it would help to have a {{logger-setup}}
command. It will create the needed dependency (in the {{pom.xml}}) and add some basic
configuration (eg. {{logback.xml}}).
A basic logger would use JUL :
{code}
logger-setup
{code}
Or we could chosse a provider
{code}
logger-setup --provider LOG4J
{code}
Being able to setup a logger
----------------------------
Key: FORGE-2318
URL:
https://issues.jboss.org/browse/FORGE-2318
Project: Forge
Issue Type: Sub-task
Components: Java EE
Affects Versions: 2.16.0.Final
Reporter: Antonio Goncalves
Fix For: 2.x Future
It would be good to have a few commands to setup a logger and inject it into bean. And
because logs are a pain (too many frameworks) it would help to have a {{logger-setup}}
command. It will create the needed dependency (in the {{pom.xml}}) and add some basic
configuration (eg. {{logback.xml}}) and why not, create a producer method so it can be
injected.
A basic logger would use JUL :
{code}
logger-setup
{code}
Or we could choose a provider and a version
{code}
logger-setup --provider LOG4J --version 4.1
{code}
The different logging frameworks are :
* JUL (out of the box, no need to have a dependency)
* LOG4J2 :
http://logging.apache.org/log4j/2.x/
* LOG4J1 :
http://logging.apache.org/log4j/2.x/manual/migration.html
* SLF4J :
http://www.slf4j.org/
* COMMONS_LOGGING :
http://commons.apache.org/proper/commons-logging/
* LOGBACK :
http://logback.qos.ch/
Setting up a logger would add the right dependency but also generate a producer that
would look like that, and therefore could be injected :
{code}
public class LoggingProducer {
@Produces
public Logger produceLogger(InjectionPoint injectionPoint) {
return
Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName());
}
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)