-
-
Notifications
You must be signed in to change notification settings - Fork 300
Eclipse Logging with Logback
Raymond Augé edited this page Jun 2, 2020
·
2 revisions
When using Eclipse with M2E a global logback config file can be used to provide tuneable logging configuration for all workspaces.
-
edit the
eclipse.inifile in the Eclipse installation directory -
add the system property
-Dlogback.configurationFile=and set the value to a shared configuration file e.g.-Dlogback.configurationFile=file:/home/me/bin/eclipse.logback.xml -
set the initial contents of this file to something like:
<configuration scan="true"> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> <pattern>%date [%thread] %-5level %logger{35} - %msg%n</pattern> </encoder> </appender> <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <File>${osgi.logfile}-0-back.log</File> <rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> <FileNamePattern>${osgi.logfile}-%i-back.log</FileNamePattern> <MinIndex>1</MinIndex> <MaxIndex>10</MaxIndex> </rollingPolicy> <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> <MaxFileSize>100MB</MaxFileSize> </triggeringPolicy> <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> <pattern>%date [%thread] %-5level %logger{35} - %msg%n</pattern> </encoder> </appender> <!--<logger name="bndtools.m2e.MavenWorkspaceRepository" level="DEBUG" />--> <root level="ERROR"> <appender-ref ref="FILE" /> <appender-ref ref="STDOUT" /> </root> </configuration>
-
notice the
FILEappenderFileNamePatternreferences an existing system property which is unique for each workspace. This means a generated log file will be contained in each workspace (as configured it will be at${workspace_loc}/.metadata/.log-%i-back.log)
- the configuration file is scanned every 30 seconds by logback engine and so Eclipse restart is not required
- add
loggerto adjust any specific logging categories as needed
Dev Meetings Agenda/Protocol
Latest Releases
all versions
- 7.2.1 | 7.2.0
- 7.1.0 | 7.0.0
- 6.4.1 | 6.4.0 | 6.3.1 | 6.3.0
- 6.2.0 | 6.1.0 | 6.0.0
- 5.3.0 | 5.2.0 | 5.1.2 | 5.1.1
- 5.1.0 | 5.0.1 | 5.0.0
- 4.3.1 | 4.3.0 | 4.2.1 | 4.2.0
- 4.1.0 | 4.0.0
- 3.5.0 | 3.4.0 | 3.3.0 | 3.2.0
- 2.2.0
Gradle
- Plugin
- Build Customizations
- Builder & java-library
- Non-Workspace builds
- PluginManagement
- Using Kotlin
- Kotlin DSL jar config
- AntTasks
- Baselining [beta]
- Blurry Form Text on High-Resolution Displays
- Bnd toolchain parity table
- bnddistribute
- Buildpath Versions
- Conflict with M2E PDE Connector
- Eclipse Logging with Logback
- Hackathon June 2012
- Install bnd on the command line
- Is there a mailing list for bnd
- Launching Framework
- Multi-project build order
- Multi-release JAR support design discussion
- Plans wrt to enRoute
- Reading Eclipse project preferences in bnd
- Release Process
- Requirements for New Repository API
- Windows Locked Files
- WIP ideas ‐ bnd 8.0.0 breaking changes
- XML Attributes on Annotations
- [ant] Loading and Expanding Shared Headers or Properties