Questions tagged [logback-groovy]

A Groovy DSL that provides an alternative to XML for configuring Logback.

A Groovy DSL that provides an alternative to XML for configuring Logback.

42 questions
2
votes
2 answers

Sprint boot - get environment or active profiles in logback.groovy

In logback-spring.xml I know it's possible to access environment properties (in my case the active profile) with but I'm looking for the groovy equivalent.
user1075613
  • 725
  • 9
  • 13
2
votes
1 answer

Variable Substitution in logback groovy

I was working with the logback.xml and the variable were load in string like : ${logDirectory}/${logFileName}.%d{yyyy-MM-dd}.%i.html where logDirectory and logFileName were set in .bat file before calling my…
Thomas Leduc
  • 1,092
  • 1
  • 20
  • 44
1
vote
1 answer

How does a Grails plugin add its own logback.groovy?

Just like to define custom Bootstrap.groovy or UrlMappings.groovy in a Grails plugin, we can define FooBootstrap.groovy or FooUrlMappings.groovy so that those can be bundled in the plugin because the earlier are excluded by default.…
Shashank Agrawal
  • 25,161
  • 11
  • 89
  • 121
1
vote
2 answers

A Logback FileAppender that uses a single log file and deletes old log files

I'm using logback, configured in a logback.groovy file, to manage logs for my applications. I want to: Create log files that are timestamped at the application launch, and retained as a single log file for the life of the application. (We might…
amaidment
  • 6,942
  • 5
  • 52
  • 88
1
vote
0 answers

Why is Logback appending time-since-start counter at start of all statements?

Here's a simplified version of my logback-spring.groovy (supported by spring boot) import ch.qos.logback.core.ConsoleAppender import static ch.qos.logback.classic.Level.INFO appender("Console-Appender", ConsoleAppender.class) { …
phanin
  • 5,327
  • 5
  • 32
  • 50
1
vote
1 answer

How to add a header on my log files using logback?

I have a class that I need to create a csv file. So what I've done so far was that: Created this class: public class MyPatternLayout extends PatternLayout { @Override public String getFileHeader() { return "message id, file…
Igor
  • 1,397
  • 3
  • 24
  • 56
1
vote
1 answer

No signature of method: logback.appender()

I have a problem running a project with logback defined through logback.groovy file. No such problem appears when running logback.xml configuration Here's an example of logback.xml config:
mrdias
  • 11
  • 2
1
vote
1 answer

Unable to load logback configuration while using logback classic with gradle

I'm trying to set up logback in a project that uses gradle as the build tool. This is the build file apply plugin: 'java' apply plugin: 'idea' apply plugin: 'groovy' apply plugin: 'maven' sourceCompatibility = 1.8 repositories { …
Shishir Joshi
  • 337
  • 1
  • 2
  • 15
1
vote
1 answer

Logback AsyncAppender unable to print method name and line number

I am using logback AsyncAppender ch.qos.logback.core.rolling.RollingFileAppender to print logs to file with following configuration. Everything is working fine if printing on console but in log file method name and line number are printing as "?"…
Himanshu Goel
  • 574
  • 1
  • 8
  • 26
1
vote
0 answers

Logback/Groovy is throwing a URL ClassCastException when trying to evaluate url.text

I'm getting this error: java.lang.ClassCastException: java.net.URL cannot be cast to java.lang.CharSequence at org.codehaus.groovy.runtime.dgm$948.doMethodInvoke(Unknown Source)> at…
Matt Whipple
  • 7,034
  • 1
  • 23
  • 34
1
vote
1 answer

WARN: [logback.groovy] (or logback.xml) occurs multiple times on classpath if logback is used in a GWT project

if you just put some logback.groovy (or logback.xml) file in the (recommended) src/logback.groovy location you will likely run into a similar (console) warning: 13:21:08,177 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource…
Andreas Covidiot
  • 4,286
  • 5
  • 51
  • 96
0
votes
0 answers

Write log messages to respective files for parallel tasks

I am running some scripts in parallel (using Gradle's maxParallelForks to run multiple threads) and using Logback for the logging. I want that each script should print their log message in the respective files which are created by their name and the…
mu1988
  • 51
  • 1
  • 7
0
votes
0 answers

The below snippet is able to generate the error level logs but is not injecting into the file

I am expecting that only error level logs will also be injecting the file. So i have applied this filter tag to filter out the error level logs. but the error logs are not injecting into the file
0
votes
0 answers

Fallback appender for Logback

Let's assume that we are using an Appender that relies on a network connection. For instance, we may be using one of the…
0
votes
1 answer

inject grailsApplication in logback

I would like to reference external config file from logback. I have an external properties file that contains the datasource, some variables I use in controllers and log configurations. Is there a way to retrieve this variables from logback…
Dany Y
  • 6,833
  • 6
  • 46
  • 83