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 <[email protected]> wrote:

> Anyone?
>
>   ------------------------------
>  *From:* Justin <[email protected]>
> *To:* "[email protected]" <[email protected]>
> *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
> [email protected]
> http://mailman.qos.ch/mailman/listinfo/logback-dev
>
>
> _______________________________________________
> logback-dev mailing list
> [email protected]
> http://mailman.qos.ch/mailman/listinfo/logback-dev
>
_______________________________________________
logback-dev mailing list
[email protected]
http://mailman.qos.ch/mailman/listinfo/logback-dev

Reply via email to