• Resolved Guyinpv

    (@guyinpv)


    Everything works good except that it doesn’t show the full message of the log entry.

    For example I log the contents of an array so I can see what they are, and the log within Debug Log Manager just shows “Array (“. That doesn’t help at all if there is no way to see the full log messages. I looked around for options or settings and didn’t see anything. I had to open the log file directly over FTP to actually see my messages, which defeats the purpose of having a live view from within WP.

    Had to uninstall since it didn’t offer any benefit without being able to see the actual log entries.

    Hopefully the feature can be added, or I missed how to enable it.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Bowo

    (@qriouslad)

    @guyinpv how exactly did you “log the contents of an array”?… Perhaps my other plugin would be more useful for that? –> https://www.ads-software.com/plugins/variable-inspector/

    Thread Starter Guyinpv

    (@guyinpv)

    For a simple use case I would just use the error_log() function and put print_r($somevar,true) inside it. This echos out the array as I’m sure you understand. But the output in your plugin didn’t show any of the content, it just showed the first few lines “array (” and then text is cut off. The actual output when I opened the log over FTP is more like:

    array (
    [0] => “My value”
    )

    But I only see that first line in the plugin.

    Your other plugin could be more useful for this case, but I do keep an eye on the log for other types of messages too.

    Plugin Author Bowo

    (@qriouslad)

    @guyinpv got it. Let me see what I can do.

    Plugin Author Bowo

    (@qriouslad)

    @guyinpv I’ve investigated the issue and I have bad and good news.

    Bad news is that you won’t be able to use error_log( print_r( $variable_name ) ) to properly view the content of a variable if it’s an array. The reason is because debug.log entries are usually a single line of string, so Debug Log Manger’s parser assume as such. print_r() on the other hand, outputs several lines of entries when outputting arrays. I’ve tried to find ways to work with that to no avail.

    Good news is, you can instead use error_log( json_encode( $variable_name ) ) that will properly output the content of the $variable_name as a single-line (JSON) string in the debug.log. The output you see on DLM’s log entries table will be a proper, multi-lines print_r() output. Please update to v2.1.0 to try it out.

    Again, I suggest using Variable Inspector which is a much better tool to inspect content of PHP variables in your code, and will help you remove the code used to inspect those variables once you’re done testing/debugging.

    p.s. if you think Debug Log Manager is more useful at v2.1.0, please consider leaving a quick review at https://www.ads-software.com/support/plugin/debug-log-manager/reviews/#new-post. Thanks again for reporting the issue!

    Thread Starter Guyinpv

    (@guyinpv)

    That sounds like a decent compromise.

    Ultimately I was looking to find a plugin that just gave me a “live feed” into the log just to avoid grabbing it over FTP repeatedly. Your plugin tries to do fancy things with the log rather than give a raw feed. I’m looking more for the raw feed style.

    Regardless, I’ll give this a try and see how it goes!

    Plugin Author Bowo

    (@qriouslad)

    @guyinpv sounds good. Seems like tail command in the terminal is better than FTP repeatedly?… eitherway, DLM with auto-refresh enabled is better I think. But do check it out yourself.

    Thread Starter Guyinpv

    (@guyinpv)

    You’re right, but a lot of hosts don’t have a terminal for that, so I’ve been looking for something I can keep open in WP itself with a live feed.

    Each method has its place, I’ll try again next chance I get!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Doesn’t show full message?’ is closed to new replies.