From: Antoine S. <aso...@gm...> - 2005-11-02 20:37:52
|
also in some situations the tags with in <tag1> <tag1> would have to change based on some situations On 11/2/05, Antoine Solomon <aso...@gm...> wrote: > > what i meant was could i generate a custom tags like > > <tag1 tag_attribute_1=3D "tag1" tag_attribute_2=3D "tag2" tag_attribute_2= =3D > "tag3"> > <another_tag> something here </another_tag> > </tag1> > > in your example are the xml all static? > > On 11/2/05, Mike Schilli <m...@pe...> wrote: > > > > On Wed, 2 Nov 2005, Antoine Solomon wrote: > > > > > Well i am using my own custom layout to create logs for a program i > > have. I > > > would like to instead create a custom XML file so that another > > application > > > can read that file. Similar to the XML::Generator perl module. I am > > sort of > > > a beginner at perl but would gladly like to help if anyone has a need > > for > > > this. > > > > Not sure what your custom format looks like but if you want something > > like > > > > <message> > > <date>2005/11/02 10:32:11</date> > > <text>A debug message!</text> > > <level>DEBUG</level> > > <category>main</category> > > </message> > > <message> > > <date>2005/11/02 10:32:11</date> > > <text>An info message!</text> > > <level>INFO</level> > > <category>main</category> > > </message> > > > > then it can be accomplished like this: > > > > use Log::Log4perl qw(:easy); > > Log::Log4perl->easy_init({ > > level =3D> $DEBUG, > > layout =3D> <<'XML'}); > > <message> > > <date>%d</date> > > <text>%m</text> > > <level>%p</level> > > <category>%c</category> > > </message> > > XML > > > > DEBUG "A debug message!"; > > INFO "An info message!"; > > > > > > -- Mike > > > > Mike Schilli > > m...@pe... > > > > > > -- > Antoine W. Solomon Jr. -- Antoine W. Solomon Jr. |