Re: [log4plsql] RE: Log4jBackgroundProcess Problem
Brought to you by:
gmoulard
From: <log...@li...> - 2004-05-07 17:31:05
|
The problem is in PLOG package body where it calls DBMS_PIPE.SEND_MESSAGE: ret :=3D DBMS_PIPE.send_message(pCTX.DBMS_PIPE_NAME); The defaults for the second and third parameters are used, which are not good for this situation. The second parameter is the max wait time in seconds, which defaults to 1000 days. The third parameter is the max pipe size, which defaults to 8K if the pipe hasn't already been created with a larger size. The thing to would be to specify a timeout for SEND_MESSAGE that is smaller, perhaps 30 seconds. Then check the return value from SEND_MESSAGE: 0 =3D success 1 =3D timeout - either the pipe was blocked by another process for the entire timeout period, or it is full. 3 =3D interrupt - don't know what this could mean, but probably not good. For status =3D 2, we could do something like this: Try to send again, hoping the pipe was just locked temporarily. If we get status 1 again, do a DBMS_PIPE.PURGE to attempt to clear the pipe (potentially losing log messages) and resend the current message. If it is still full or locked, raise an error or some other logging error handling mechanism. Perhaps Log4Plsql should take a cue from Log4J and only log once to some central place (it uses standard output) when it encounters a logging error, and does not attempt any more logging. Log4Plsql could log the first logging error (table error, pipe error, etc.) to the alert log or something, then set a package flag that stops all future logging for that session. I also have some pending changes that completely re-do the background process, making it available to include in a Java App Server application for more robust pipe listening. Greg Woolsey Sabrix Inc. On Thu, 6 May 2004 19:26:07 +0200, log...@li... <log...@li...> wrote: >=20 > Hi Jose, >=20 > For ChainSAW could you use pLOGTABLE =3D> TRUE. I think is only necessary= to log in table. >=20 > In my 10G when a log with pLOG4J =3D> TRUE, if there is no Log4jBackgroun= dProcess, my plsql block is in wait. When I launch the > Log4jBackgroundProcess the process restart to log. >=20 > Be careful, if you shutdown you database, all message in pipe is lost. >=20 > -- My test case ----------------------- >=20 > Declare >=20 > pCTX PLOG.LOG_CTX :=3D PLOG.init (pSECTION =3D> 'firstSection', >=20 > pLEVEL =3D> PLOG.LDEBUG, >=20 > pLOG4J =3D> TRUE >=20 > ); >=20 > begin >=20 > for i in 1..2000 loop >=20 > PLOG.debug (pCTX, 'Hello LOG:'||i); >=20 > end loop; >=20 > end; >=20 > / >=20 > Regards, > Guillaume Moulard > gmo...@us... >=20 > Project : LOG4PLSQL : Oracle Database Loggin tools > see : http://log4plsql.sourceforge.net/ > and : http://sourceforge.net/mailarchive/forum.php?forum=3Dlog4plsql-all= -info or > http://www.mail-archive.com/log...@li... > for log...@li... >=20 > -----Message d'origine----- > De : SAG - Jose Antonio Tarifa >=20 > Envoy=E9 : jeudi 6 mai 2004 15:05 > =C0 : Guillaume Moulard > Objet : RE: Log4jBackgroundProcess Problem >=20 > Hello Guillaume, >=20 > thank your for your reply. But my problem is another. >=20 > We MUST use pLOG4J =3D> TRUE, because we want to trace every log in our C= hainSAW client. But the problem is when > Log4jBackgroundProcess is not running because an error in Java or another= problem (imagine the process shuts down suddenly because a > socket error, or anything else). Then, Oracle seems to be blocked sendin= g logs through the pipe to the process. And that is my > problem, if the process stops suddenly, every PL/SQL procedure in our dat= abase using Log4PLSQL are blocked. >=20 > greetings, >=20 > Jos=E9 Antonio Tarifa Lorenzo >=20 > -----Mensaje original----- >=20 > De: Guillaume Moulard [mailto:gmo...@us...] >=20 > Enviado el: jueves, 06 de mayo de 2004 13:03 >=20 > Para: log...@li... >=20 > Asunto: RE: Log4jBackgroundProcess Problem >=20 > Jos=E9, >=20 > If you don't use in the context the pLOG4J =3D> TRUE it in not necessary = to lauche the Log4jBackgroundProcess. >=20 > I don't now the unstable behaviour of Oracle when PL/SQL code writes a lo= g. Perapse you can send more informations about you >=20 > problem. >=20 > Regards, >=20 > Guillaume Moulard >=20 > gmo...@us... >=20 > Project : LOG4PLSQL : Oracle Database Loggin tools >=20 > see : http://log4plsql.sourceforge.net/ >=20 > and : http://sourceforge.net/mailarchive/forum.php?forum=3Dlog4plsql-all= -info or >=20 > http://www.mail-archive.com/log...@li... >=20 > for log...@li... >=20 > -----Message d'origine----- >=20 > De : jatarifa >=20 > Envoy=E9 : vendredi 30 avril 2004 11:05 >=20 > =C0 : gmo...@us... >=20 > Objet : Log4jBackgroundProcess Problem >=20 > Hello Guillaume. >=20 > I am the technical consultor of OMEL (Operador del Mercado >=20 > Electrico Espa=F1ol - http://www.omel.es) and we are very >=20 > interested to incorporate your development to our Database, >=20 > because we think is a great tool to monitorize the electricity >=20 > market. >=20 > But we have a problem. We have put in our test environment >=20 > the latest version of Log4PLSQL and we have noticed an >=20 > unstable behaviour of Oracle when PL/SQL code writes a log >=20 > to Log4jBackgroundProcess and this Java program is not >=20 > running. >=20 > Oracle seems to be locked on PLOG statement on PL/SQL >=20 > code until Log4jBackgroundProcess is started!!! >=20 > Is that a normal behaviour (I think no) of Oracle or is >=20 > something wrong in PLOG PLSQL code? >=20 > As I said after, we are very interested in Log4PLSQL and the >=20 > Spain Electricity Market would be improved with this tool. >=20 > Thank you >=20 > Jos=E9 Antonio Tarifa >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by Sleepycat Software > Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to > deliver higher performing products faster, at low TCO. > http://www.sleepycat.com/telcomwpreg.php?From=3Dosdnemail3 > _______________________________________________ > Log4plsql-all-info mailing list > Log...@li... > https://lists.sourceforge.net/lists/listinfo/log4plsql-all-info > log4plsq : http://log4plsql.sourceforge.net > |