Vista Combinata Vista Piatta Vista ad Albero
Discussioni [ Precedente | Successivo ]
toggle
Björn Ryding
SL4J adapter for Liferay's logging service
12 gennaio 2012 1.21
Risposta

Björn Ryding

Punteggio: Liferay Master

Messaggi: 582

Data di Iscrizione: 16 maggio 2007

Messaggi recenti

In our projects we use SL4J for logging.

from sl4j.org:
"The Simple Logging Facade for Java or (SLF4J) serves as a simple facade or abstraction for various logging frameworks, e.g. java.util.logging, log4j and logback, allowing the end user to plug in the desired logging framework at deployment time."

A couple of months ago a team mate created a SL4J adapter for Liferay's logging service. We replaced the sl4j adapter for log4j that Liferay ships with (sl4j-log4j12.jar) with the new adapter and now copy the adapter to our plugins at deploy time by defining the adapter as a dependency in portal.dependency.jars in liferay-plugin-package.properties.

We can now control log levels in the control panel and so on for the plugins that use SL4J.

The code is available at https://github.com/bjorn-ryding/slf4j-liferay-adapter

Could it be interesting to ship Liferay with this adapter? VGR who financed the development is willing to donate the code.

Cheers,
Björn
Sampsa Sohlman
RE: SL4J adapter for Liferay's logging service
3 settembre 2012 14.51
Risposta

Sampsa Sohlman

LIFERAY STAFF

Punteggio: Regular Member

Messaggi: 225

Data di Iscrizione: 27 settembre 2007

Messaggi recenti

Hi Björn

This is great stuff. I was thinking to do same couple of years ago, but did not anything about it. Slf4j it is easy to bind most of the application servers at market, so please I make issue to LR jira and I will vote for it.

- Sampsa
Björn Ryding
RE: SL4J adapter for Liferay's logging service
2 ottobre 2012 1.07
Risposta

Björn Ryding

Punteggio: Liferay Master

Messaggi: 582

Data di Iscrizione: 16 maggio 2007

Messaggi recenti

Thanks Sampsa!

Liferay actually implemented a similar solution shortly after my post. Their implementation is in util-java and makes it trivial to use the Liferay logging system through SLF4J in Liferay 6.1. However, if you would like to use another SLF4J binding than the Liferay one it's a bit annoying that their implementation ended up in util-java.

Cheers,
Björn
Denis Signoretto
RE: SL4J adapter for Liferay's logging service
14 agosto 2013 5.51
Risposta

Denis Signoretto

Punteggio: Expert

Messaggi: 307

Data di Iscrizione: 21 aprile 2009

Messaggi recenti

Hi,

recently Liferay has released util-slf4j (still as beta version) an slf4j binder for Liferay logging system.
Moreover it can be managed as Maven dependecy whit the following GAV:

<name>Liferay Util SLF4J</name>
<groupId>com.liferay.portal</groupId>
<artifactId>util-slf4j</artifactId>
<version>6.2.0-B1</version>

Regards,
Denis.
Ryan Kennedy
RE: SL4J adapter for Liferay's logging service
7 gennaio 2014 12.51
Risposta

Ryan Kennedy

Punteggio: New Member

Messaggi: 4

Data di Iscrizione: 14 febbraio 2013

Messaggi recenti

Is this dependency intended for the pom in a portlet? If so, it doesn't seem to work in 6.1.20-ee-ga2. If not, can someone please explain how to configure slf4j?
Mika Koivisto
RE: SL4J adapter for Liferay's logging service
7 gennaio 2014 16.36
Risposta

Mika Koivisto

LIFERAY STAFF

Punteggio: Liferay Legend

Messaggi: 1513

Data di Iscrizione: 7 agosto 2006

Messaggi recenti

You need to use EE artifacts when using EE portal. Those are not available publicly, you will need to download them from customer portal and install them to a local repository.