log4j Cloud Logging Appender

This project helps logging all log messages to Google Cloud Logging via an log4j2 Appender.

License

License

Categories

Categories

Logging Application Layer Libs
GroupId

GroupId

eu.zirrus
ArtifactId

ArtifactId

cloud-logging-log4j
Last Version

Last Version

0.1.1
Release Date

Release Date

Type

Type

jar
Description

Description

log4j Cloud Logging Appender
This project helps logging all log messages to Google Cloud Logging via an log4j2 Appender.
Project URL

Project URL

https://github.com/Zirrus/google-cloud-logging-log4j
Project Organization

Project Organization

Zirrus Cloud Service GmbH
Source Code Management

Source Code Management

https://github.com/Zirrus/google-cloud-logging-log4j/tree/master

Download cloud-logging-log4j

How to add to project

<!-- https://jarcasting.com/artifacts/eu.zirrus/cloud-logging-log4j/ -->
<dependency>
    <groupId>eu.zirrus</groupId>
    <artifactId>cloud-logging-log4j</artifactId>
    <version>0.1.1</version>
</dependency>
// https://jarcasting.com/artifacts/eu.zirrus/cloud-logging-log4j/
implementation 'eu.zirrus:cloud-logging-log4j:0.1.1'
// https://jarcasting.com/artifacts/eu.zirrus/cloud-logging-log4j/
implementation ("eu.zirrus:cloud-logging-log4j:0.1.1")
'eu.zirrus:cloud-logging-log4j:jar:0.1.1'
<dependency org="eu.zirrus" name="cloud-logging-log4j" rev="0.1.1">
  <artifact name="cloud-logging-log4j" type="jar" />
</dependency>
@Grapes(
@Grab(group='eu.zirrus', module='cloud-logging-log4j', version='0.1.1')
)
libraryDependencies += "eu.zirrus" % "cloud-logging-log4j" % "0.1.1"
[eu.zirrus/cloud-logging-log4j "0.1.1"]

Dependencies

compile (3)

Group / Artifact Type Version
org.apache.logging.log4j : log4j-api jar 2.8.2
org.apache.logging.log4j : log4j-core jar 2.8.2
com.google.cloud : google-cloud-logging jar 1.2.1

test (1)

Group / Artifact Type Version
junit : junit jar 3.8.1

Project Modules

There are no modules declared in this project.

Google Cloud Logging lo4j2 appender

This project helps logging all log messages to Google Cloud Logging via an log4j2 Appender.

Installation

Add the following maven dependency to your pom.xml:

    <dependency>
      <groupId>eu.zirrus.gcloud.logging</groupId>
      <artifactId>log4j</artifactId>
      <version>0.1.0</version>
    </dependency>

or with gradle:

compile 'eu.zirrus.gcloud.logging:log4j:0.1.0'

Configuration

This is a sample config which adds a CloudLogging Appender called CloudLogginTest. The Appender is wrapped in an AsyncAppender to run in non-blocking mode.

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO">
  <Appenders>
    <CloudLogging name="CloudLoggingTest" projectId="allcyte-akira">
      <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
    </CloudLogging>
    <Console name="Console">
      <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n"/>
    </Console>
    <Async name="CloudLoggingAsync">
      <AppenderRef ref="CloudLoggingTest"/>
    </Async>
  </Appenders>
  <Loggers>
    <Root level="info">
      <AppenderRef ref="Console" level="error"/>
      <AppenderRef ref="CloudLoggingAsync" />
    </Root>
  </Loggers>
</Configuration>
eu.zirrus

Zirrus Cloud Service GmbH

Versions

Version
0.1.1