Giter Site home page Giter Site logo

slf4j-equinox's Introduction

SLF4J Equinox Maven Central Javadocs

This is an implementation of SLF4J using the Equinox ExtendedLogService.

In plain words it makes all code that uses SLF4J log to the Equinox .metadata/.log log file. It does this by redirecting all the log messages to the Equinox ExtendedLogService. This is mostly interesting for code that runs inside Eclipse RCP applications. This does not make Equinox use SLF4J.

Versions 2.x are for SLF4J 2 and rely on ServiceLoader.

Versions 1.x are for SLF4J 1 and are a fragment.

Caveats

  • the Equinox context object is always null
  • the SLF4J markers are ignored

This shouldn't be installed along side ch.qos.logback.slf4j, org.slf4j.impl.log4j12 or , slf4j.nop.

There are two SLF4J bundles the Maven artifact uses slf4j.api the Orbit uses org.slf4j.api.

Implementation Notes

We keep a ConcurrentHashMap of strings to logger adapters. A ConcurrentHashMap uses more memory than HashMap but allows for concurrent lookups even though ExtendedLogServiceImpl#getLogger is synchronized. The values are not weak for now as Log4jLoggerFactory doesn't use weak values as well.

We rely on OSGi Service Loader Mediator

Building

If you want to build this project then you need Maven 3 and add the following section to your settings.xml

<profile>
  <id>eclipse</id>
  <activation>
    <activeByDefault>false</activeByDefault>
  </activation>
  <repositories>
    <repository>
      <id>eclipse-28</id>
      <layout>p2</layout>
      <url>https://download.eclipse.org/eclipse/updates/4.28/</url>
    </repository>
    <repository>
      <id>eclipse-28-local</id>
      <url>file:///home/user/bin/eclipse/eclipse-4.28</url>
    </repository>
  </repositories>
</profile>

Publishing

To publish the artifact to a p2 site (or build a new one) you can use the Features And Bundles Publisher Application

java -jar <targetProductFolder>/plugins/org.eclipse.equinox.launcher_*.jar \
-application org.eclipse.equinox.p2.publisher.FeaturesAndBundlesPublisher \
-metadataRepository file:/<some location>/repository \
-artifactRepository file:/<some location>/repository \
-source /<location with a plugins and features directory> \
-configs gtk.linux.x86 \
-compress \
-publishArtifacts

Installing

You can install form the site you built above using the p2 director application

java -jar <targetProductFolder>/plugins/org.eclipse.equinox.launcher_*.jar \
-application org.eclipse.equinox.p2.director \
-repository file:/<some location>/repository \
-installIU com.github.marschall.slf4j-equinox \
-uninstallIU org.slf4j.log4j,ch.qos.logback.slf4j,org.eclipse.jetty.slf4jlogback.feature.group,org.eclipse.jetty.sdk.feature.group \
-tag slf4j-equinox \
-destination <targetProductFolder>

slf4j-equinox's People

Contributors

marschall avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

slf4j-equinox's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.