5

JLog is serializing everything in its way

$signature = md5(serialize($options));

https://github.com/joomla/joomla-cms/blob/ac589fd45aaa88a5e9d972cacceec083cb4c754b/libraries/joomla/log/log.php#L191

In our plugin we are reading xml file to get the template version tag https://github.com/YJSGframework/yjsg/blob/master/includes/yjsgcore/classes/yjsg.class.php#L380

But with joomla debug on, that data gets serialized and I get an error .

 Serialization of 'SimpleXMLElement' is not allowed

If I try to unserialzie SimpleXMLElement data I get no data back .

Is there a way to exclude specific files or views from Jlog ?

update: Dmitry pushed me to check more and here is what I get

error everything on http://prntscr.com/5d51ip

changed signatrue var http://prntscr.com/5d51tx

no SimpleXMLElement error. http://prntscr.com/5d51yg

or if I change serialize to json_decode

$signature = md5(json_decode($options));

everything works.

  • 2
    Are you sure that it's a JLog problem? It is serializing only $options, not everything. – Dmitry Rekun Dec 4 '14 at 14:41
  • testing all option as we speak but it does look like it – Dan Dec 4 '14 at 14:51
  • @DmitryRekun I traced it back from debug plugin line 147 prntscr.com/5d4zzp, when that line is removed everything is ok. Now it might not be the signature line but it is addLogger method – Dan Dec 4 '14 at 15:12
2

I'm not sure that this will solve your problem, but it does answer your question in that you referenced libraries/joomla/log/log.php.

Per Using JLog, and the JLog Class Reference, only the component, output file, priority, and format can be specified, but nothing else - no exclusions.

Also, this applies to adding a jLog to your code, unless you're intending to change core files and set options there.

On a side note, I've noticed that when I specify a file name for output, it seems to become the default file for Joomla once a log entry is made. I haven't had a chance to investigate it, and it hasn't interfered, but may be handy to know.

  • I Up you for the actual answer. but the solution is , remove xml data from class public var , the bug is still valid as I pointed out above – Dan Dec 4 '14 at 21:03
  • 1
    +1 for the question to begin with, and I didn't think it would actually solve the problem as I said :). I just wanted to contribute something to anyone that might need an answer the question asked - bug or not :) – GDP Dec 4 '14 at 21:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.