From: Antoine S. <aso...@gm...> - 2005-11-01 15:29:14
|
hello all, I've been using Log4Perl for a project a particular project for sometime now. I was woundering if anyone ever Changed the layout to make a custom xm= l layout ? -- Antoine W. Solomon Jr. |
From: Mike S. <m...@pe...> - 2005-11-02 06:57:47
|
On Tue, 1 Nov 2005, Antoine Solomon wrote: > I've been using Log4Perl for a project a particular project for > sometime now. I was woundering if anyone ever Changed the layout to > make a custom xml layout ? Currently, there's PatternLayout and SimpleLayout. If you have ideas on a new XML layout, let us know what you're envisioning! -- Mike Mike Schilli m...@pe... |
From: Antoine S. <aso...@gm...> - 2005-11-02 16:54:38
|
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. Antoine On 11/2/05, Mike Schilli <m...@pe...> wrote: > > On Tue, 1 Nov 2005, Antoine Solomon wrote: > > > I've been using Log4Perl for a project a particular project for > > sometime now. I was woundering if anyone ever Changed the layout to > > make a custom xml layout ? > > Currently, there's PatternLayout and SimpleLayout. If you have ideas on > a new XML layout, let us know what you're envisioning! > > -- Mike > > Mike Schilli > m...@pe... > -- Antoine W. Solomon Jr. |
From: Mike S. <m...@pe...> - 2005-11-02 18:34:35
|
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 => $DEBUG, layout => <<'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... |
From: Antoine S. <aso...@gm...> - 2005-11-03 04:51:57
|
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 sor= t > 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 lik= e > > <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. |
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. |
From: Mike S. <m...@pe...> - 2005-11-04 03:26:00
|
On Wed, 2 Nov 2005, Antoine Solomon wrote: > what i meant was could i generate a custom tags like > > <tag1 tag_attribute_1= "tag1" tag_attribute_2= "tag2" tag_attribute_2= > "tag3"> > <another_tag> something here </another_tag> > </tag1> > > in your example are the xml all static? I don't see the connection to Log4perl in your XML. Can you elaborate what exactly you want to log? An example of a logging statement like $logger->debug('message'); and the XML output you want it to generate would be helpful. -- Mike Mike Schilli m...@pe... > > 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 => $DEBUG, > > layout => <<'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. > |