title: Simple Groovy Logback Configuration for Multiple Scripts
body: <p>I have the following:</p>
  
  <p>C:\Scripts\Groovy\foo.groovy</p>
  
  <pre><code>@Grab (group = 'ch.qos.logback', module = 'logback-classic', version = '1.1.3')
  def logger = org.slf4j.LoggerFactory.getLogger ('foo')
  logger.info ("Hello, Foo!')
  </code></pre>
  
  <p>C:\Scripts\Groovy\bar.groovy</p>
  
  <pre><code>@Grab (group = 'ch.qos.logback', module = 'logback-classic', version = '1.1.3')
  def logger = org.slf4j.LoggerFactory.getLogger ('bar')
  logger.info ("Hello, Bar!')
  </code></pre>
  
  <p>Scripts are executed via <code>groovy foo.bar</code> and <code>groovy bar.groovy</code> respectively.</p>
  
  <p>Questions:</p>
  
  <ol>
  <li>What lines of code can be added to each script to append log
  messages to "foo.log" and "bar.log" respectively? </li>
  <li>Can individual
      configuration files be created, for example "logback_foo.groovy" and
      "logback_bar.groovy", to append log messages to log files?</li>
  <li>Can a
      common configuration file, for example "logback.groovy", be used to
      append messages to log files for each script?</li>
  </ol>
  
  <p>I have multiple small utility scripts and do not want to go through the effort of setting up a Gradle project for each script.  I do utilize Gradle for significant projects and I have been successful in getting a larger project functional.</p>
  
  <p>I am new to both Groovy and LogBack so please provide contents of each script/configuration file and commands to execute the scripts.</p>