[logback-dev] Source for PropertiesTranslator

Tony Trinh tony19 at gmail.com
Fri Oct 18 05:59:07 CEST 2013


You can use simple curl requests to translate your files. The following
scripts work on OSX, but you could easily adapt them for other *nixes if
necessary.


logback_xml_to_groovy.sh:

#!/bin/bash
##############################################
# Prints the groovy equivalent of the given logback.xml file.
# Redirect to a file.
#
# Usage:
#   $ logback_xml_to_groovy.sh path/to/logback.xml > path/to/file.groovy
#
##############################################
[ -z $1 ] && echo 'syntax error' && exit 1
printf val=%s $(cat $1 | curl -Gso /dev/null -w %{url_effective}
--data-urlencode @- "" | cut -c 3-) | curl -X POST -d @-
http://logback.qos.ch/translator/dsl/asGroovy


log4j_to_logback.sh

#!/bin/bash
##############################################
# Prints the XML equivalent of the given log4j.properties file.
# Redirect to a file.
#
# Usage:
#   $ log4j_to_logback.sh path/to/log4j.properties > path/to/logback.xml
#
##############################################
[ -z $1 ] && echo 'syntax error' && exit 1
printf val=%s $(cat $1 | curl -Gso /dev/null -w %{url_effective}
--data-urlencode @- "" | cut -c 3-) | curl -X POST -d @-
http://logback.qos.ch/translator/dsl/propertiesToXML




On Thu, Oct 17, 2013 at 7:37 PM, Justin <crynax at yahoo.com> wrote:

> Anyone?
>
>   ------------------------------
>  *From:* Justin <crynax at yahoo.com>
> *To:* "logback-dev at qos.ch" <logback-dev at qos.ch>
> *Sent:* Monday, October 7, 2013 11:49 AM
> *Subject:* [logback-dev] Source for PropertiesTranslator
>
> Hi all,
>
> Is source or pseudo code available for PropertiesTranslator?
>
> http://logback.qos.ch/translator/
> http://logback.qos.ch/translator/asGroovy.html
>
> I'm interested in upgrading existing customer installations from log4j to
> logback without sending them to the website. Either XML or Groovy is
> acceptable.
>
> Thanks for any help,
> Justin
>
> _______________________________________________
> logback-dev mailing list
> logback-dev at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-dev
>
>
> _______________________________________________
> logback-dev mailing list
> logback-dev at qos.ch
> http://mailman.qos.ch/mailman/listinfo/logback-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-dev/attachments/20131017/28c6a5b7/attachment-0001.html>


More information about the logback-dev mailing list