Switch branches/tags
Find file History
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Run google-java-format on all artifacts (#4121) Nov 30, 2018
README.md Release google-cloud-java v0.73.0 (#4191) Dec 7, 2018
pom.xml Bump next snapshot (#4192) Dec 7, 2018


Logback Appender for Google Cloud Logging

Logback appender com.google.cloud.logging.logback.LoggingAppender for Google Cloud Logging.

This library allows you to use Logback configuration and the Slf4j interface to log via Google Cloud logging.

Note: This client is a work-in-progress, and may occasionally make backwards-incompatible changes.


If you are using Maven, add this to your pom.xml file


If you are using Gradle, add this to your dependencies

compile 'com.google.cloud:google-cloud-logging-logback:0.73.0-alpha'

If you are using SBT, add this to your dependencies

libraryDependencies += "com.google.cloud" % "google-cloud-logging-logback" % "0.73.0-alpha"


Add the appender to your Logback configuration logback.xml. See Logback filters for information on filtering log output and encoders for information on formatting.

  <appender name="CLOUD" class="com.google.cloud.logging.logback.LoggingAppender">
    <!-- Optional : filter logs at or above a level -->
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
    <log>application.log</log> <!-- Optional : default java.log -->
    <enhancer>com.example.enhancers.TestLoggingEnhancer</enhancer> <!-- Optional -->
    <enhancer>com.example.enhancers.AnotherEnhancer</enhancer> <!-- Optional -->
    <flushLevel>WARN</flushLevel> <!-- Optional : default ERROR -->

  <root level="info">
    <appender-ref ref="CLOUD" />

In your code :

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class TestLogger {
    private final Logger logger = LoggerFactory.getLogger(TestLogger.class);
    public void log(String name) {
        logger.info("This is a test");

    public static void main(String[] args) {
        TestLogger testLogger = new TestLogger();


See the Authentication section in the base directory's README.


This library is usable, but not yet complete. Open issues here.

Java Versions

Java 7 or above is required for using this client.


This library follows Semantic Versioning.

It is currently in major version zero (0.y.z), which means that anything may change at any time and the public API should not be considered stable.


Contributions to this library are always welcome and highly encouraged.

See google-cloud's CONTRIBUTING documentation and the shared documentation for more information on how to get started.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms. See Code of Conduct for more information.


Apache 2.0 - See LICENSE for more information.