tag:blogger.com,1999:blog-34020393.post116357294545906013..comments2024-03-27T10:59:38.307-07:00Comments on Jim's PeopleSoft Journal: log4j and PeopleCode Part IIJim Marionhttp://www.blogger.com/profile/12995110203807924786noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-34020393.post-41470961891579000562013-04-12T08:54:14.507-07:002013-04-12T08:54:14.507-07:00Hi Jim,
Yes, we are using the same version of log...Hi Jim,<br /><br />Yes, we are using the same version of log4j that shipped with Peopletools v8.52.<br />We didn't have any issues while instantiating log4j classes from application engine. We were having those issues only when calling from online peoplecode.Sri Reddyhttps://www.blogger.com/profile/12155550389128389086noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-56244489210298645412013-04-12T07:45:55.536-07:002013-04-12T07:45:55.536-07:00@Sri, Good to hear that you have it working and fi...@Sri, Good to hear that you have it working and find it valuable. Are you using the version of log4j that ships with PeopleSoft or are you using a different version?Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-1275847099644113302013-04-11T11:41:57.453-07:002013-04-11T11:41:57.453-07:00Hi Jim,
I figured out the issue. I am not able to ...Hi Jim,<br />I figured out the issue. I am not able to instantiate the logger class in the constructor of the service handler class. But, I am able to instantiate in the OnRequest method.<br /><br />I don't know the reason why I am getting the Java errors while instantiating from constructors.<br /><br />Also, I faced one more issue while using log4j from an online application. Sytem is throwing ANNOTATION java errors because of the reflection used in the logmanager class.<br /><br />I modified the code in initialize method of logmanager class to instantiate logger without using reflection. Then, It started working.<br /><br />I really liked this log4j logging. We incorporated in our webservice consumption framework. It's very helpful for the developers to debug the service handlers.Sri Reddyhttps://www.blogger.com/profile/12155550389128389086noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-79007974713677949942013-04-11T10:27:28.287-07:002013-04-11T10:27:28.287-07:00@Sri, Off the top of my head, I can't think of...@Sri, Off the top of my head, I can't think of any reason you would receive errors. What error messages are you receiving?Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-13083936453234033012013-04-10T15:48:37.579-07:002013-04-10T15:48:37.579-07:00Hi Jim,
Last week, I read your PeopleSoft Peopleto...Hi Jim,<br />Last week, I read your PeopleSoft Peopletools tips & techniques and tried to implement log4j logging framework in the PeopleSoft.<br /><br />Following things, I successfully implemented using log4J:<br />1.) logging framework for batch process (app engine)<br />2.) logging framework for debugging online pages<br /><br />Issues encountered:<br />1.) Getting java errors when trying to implement log4j logging framework in the integration broker subscription peoplecode. (webservice consumption framework).<br /><br />Do you know the reason why your log4j framework is failing for IB subscription peoplecode and is there any workaround for it?<br /><br />Thanks<br />SriSri Reddyhttps://www.blogger.com/profile/12155550389128389086noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-83637337582298976482009-02-16T11:43:00.000-08:002009-02-16T11:43:00.000-08:00@Ganesh, Oracle delivers log4j with PeopleSoft. Ho...@Ganesh, Oracle delivers log4j with PeopleSoft. How do delivered PeopleSoft applications use log4j? I have no idea. Where can you use it? Any PeopleCode where you want targeted logging/tracing for debugging or application management. What delivered PeopleCode options exist? The PeopleCode MessageBox statement provides targeted logging/debugging information. The problem with MessageBox is that you have to modify your code when you want to print statements, and then modify it again when you want to stop printing statements. log4j offers a configurable alternative. You can litter your code with trace, debug, info, warn, error, and fatal statements and can figure whether or not those statements print. You don't have to delete them when you finish your debugging process. The only delivered configurable alternative is PeopleCode trace settings. The problem with trace settings is they log everything. They aren't targeted. You can't pick and choose what to log. Reviewing a PeopleCode trace file for errors is truly like sipping from a fire hose.<BR/><BR/>What is my need for log4j? Targeted and configurable logging/tracing. I can print what I want when I want. There are no PeopleCode/PeopleSoft options that provide this capability.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-78914337618732922292009-02-15T02:46:00.000-08:002009-02-15T02:46:00.000-08:00can someone explain me the real use of the Log4J i...can someone explain me the real use of the Log4J in the peoplesoft. What is the need for Log4J ?<BR/>Example where this will be required and why not any peoplesoft delivered methods can be used to log error message.Ganeshhttps://www.blogger.com/profile/05671330781617372189noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-2671885938264563102008-09-05T09:30:00.000-07:002008-09-05T09:30:00.000-07:00@kane81, Calling logger.error from PeopleCode.@kane81, <A HREF="http://jjmpsj.blogspot.com/2008/09/calling-log4js-loggererror-from.html" REL="nofollow">Calling logger.error from PeopleCode</A>.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-75398683756180720962008-09-05T08:56:00.000-07:002008-09-05T08:56:00.000-07:00I should read my own posts... The last sentence of...I should read my own posts... The last sentence of my post says, "As you know, error is a key word in PeopleCode..."Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-38707045004712078412008-09-02T22:12:00.000-07:002008-09-02T22:12:00.000-07:00@kane81, you are right. I forgot about that. Now, ...@kane81, you are right. I forgot about that. Now, I know that error is a function, but I'm not sure if it is a reserved/keyword. In otherwords, if you precede it with an object and a dot (&logger.) then I think PeopleCode will execute it as a method, not the error function. If you type the code and the PeopleCode validator points it out as an error or if it doesn't work, then you can use Java Reflection. I have a few examples of reflection labeled <A HREF="http://jjmpsj.blogspot.com/search/label/Java%20Reflection" REL="nofollow">Java Reflection</A>. Chris Heller has a nice <A HREF="http://blog.greysparling.com/2006/08/java-and-peoplecode-tips-and-tricks.html" REL="nofollow">Java Reflection</A> post as well. If you write a reflection example, can you post it here? I'll do likewise. I'll see if I can get an example up here sometime before the end of the week.Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-31855630143274947392008-09-02T21:30:00.000-07:002008-09-02T21:30:00.000-07:00thanks will try it..."error" is a keywor...thanks will try it...<BR/><BR/>"error" is a keyword in people code so you cant do <BR/><BR/>&logger.error("this is the error message");kane81https://www.blogger.com/profile/14471355777720928832noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-45535315582920014672008-09-02T09:16:00.000-07:002008-09-02T09:16:00.000-07:00It sounds like Xerces is registering itself as the...It sounds like Xerces is registering itself as the DOM implementation which confirms that xerces is in your classpath. Your xerces.jar file has a file called META-INF/services/javax.xml.parsers.DocumentBuilderFactory, doesn't it? Maybe your jar file is corrupt. It is possible that some of the classes in your jar are corrupt. Can you redeploy PeopleTools and grab a fresh copy of xerces? The jar's manifest file should have the Xerces implementation version number, so you could download a fresh copy from Apache as well.<BR/><BR/>If you can't get the log4j.xml file to work, you can use the log4j.properties file format instead.<BR/><BR/>Log.error is the same as log.debug and log.fatal, as demonstrated in the post. Just type:<BR/><BR/>&logger.error("this is the error message");Jim Marionhttps://www.blogger.com/profile/12995110203807924786noreply@blogger.comtag:blogger.com,1999:blog-34020393.post-64648588259025752882008-08-31T20:41:00.000-07:002008-08-31T20:41:00.000-07:00Hi,I've implemented Log4J in PT844, but I have a p...Hi,<BR/><BR/>I've implemented Log4J in PT844, but I have a problem when I use log4j.xml property file - (all works fine if I config by code)....<BR/><BR/>I have put my log4j.xml file in<BR/><BR/>C:\psoft\c3sb1\pt844\class\log4j.xml<BR/><BR/>I get a java exception<BR/><BR/>javax.xml.parsers.FactoryConfigurationError: Provider org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found during call org.apache.log4j.Logger.getLogger<BR/><BR/>any ideas why I get this error when using the xml file? <BR/><BR/>I checked the C:\psoft\c3sb1\pt844\class\xerces.jar file and it has the DocumentBuilder class<BR/><BR/>so I'm not sure what is wrong....<BR/><BR/>also anyone got any code that shows how to call Log.Error()?<BR/><BR/>Thanks so much!kane81https://www.blogger.com/profile/14471355777720928832noreply@blogger.com