tag:support.pimpmylog.com,2013-12-07:/discussions/problems/212-generating-statisticsPimp my Log: Discussion 2017-09-02T17:53:29Ztag:support.pimpmylog.com,2013-12-07:Comment/432953452017-08-26T16:54:14Z2017-09-02T17:53:29ZGenerating statistics<div><p>Ciao!</p>
<p>How are you?</p>
<p>I have created a generator that creates a config.user.php but it looks like if I use <code>JSON.parse</code> and then <code>JSON.stringify</code> , but it is weird, because the config file that looks like JSON, it is <code>encode</code> or something, but <code>JSON</code> removes it.<br>
Do you have an idea I would generate <code>JSON</code> strings that are <code>encoded</code>? Because <code>JSON</code> removes all my <code>escaped</code> data.</p>
<p>Like it needs:<br>
<code>\/var\/log\/nginx\/domain.com-access.log</code>, but it truns into <code>/var/log/nginx/domain.com-access.log</code>.</p>
<p>How can this be fixed?<br>
I doesn't look like valid JSON by specs or I am wrong?</p>
<p>It is hard to create 40 logs, because I do not want to have all in only in <code>acccess.log</code> and <code>errors.log</code>.</p>
<p>So that is my problems.</p>
<p>If you could help I could use it, I would be be very thankful!</p>
<p>Bye,<br>
Patrik</p></div>alabardtag:support.pimpmylog.com,2013-12-07:Comment/432953452017-08-26T19:03:17Z2017-08-26T19:03:17ZGenerating statistics<div><p>Hi !</p>
<p>your message is a little bit... not escaped ! Nevermind ;-)</p>
<p>Why not replacing all slashes <code>/</code> by <code>\/</code> before saving your configuration file ?</p></div>potskytag:support.pimpmylog.com,2013-12-07:Comment/432953452017-08-28T18:14:20Z2017-08-28T18:14:20ZGenerating statistics<div><p>Hey!<br>
How are you?<br>
Ok, thanks so much! But which keys should be added with addslashes, because<br>
it is not for all of them, right?<br>
You mind to know?<br>
Have happy day!<br>
Ciao!</p>
<p><em>Patrik</em> WWW <a href="https://patrikx3.tk">https://patrikx3.tk</a> | GitHub <a href="https://github.com/patrikx3/">https://github.com/patrikx3/</a> | NPM<br>
<a href="https://www.npmjs.com/%7Epatrikx3">https://www.npmjs.com/~patrikx3</a> | Corifeus <a href="https://corifeus.tk">https://corifeus.tk</a> | +36 20<br>
342 8046</p></div>alabardtag:support.pimpmylog.com,2013-12-07:Comment/432953452017-09-01T19:21:14Z2017-09-01T19:21:14ZGenerating statistics<div><p>yeah, it is totally just a non JSON setting, only hacking can fix it.<br>
This is pimpmylog data. Not JSON at all.<br>
I am hacking.</p></div>alabardtag:support.pimpmylog.com,2013-12-07:Comment/432953452017-09-01T19:53:28Z2017-09-01T19:53:28ZGenerating statistics<div><p>Ciao! How are you? I fixed it in a hackish fix, but it would be good if it<br>
was real JSON for the settings, because totally not JSON.<br>
Somehow in PHP and some helpers that change that data, but it is not JSON<br>
and it is very hard to work a hacked settings, when every one uses JSON<br>
(Owncloud, NextcLoud, phpMyAdmin, Roundcube, etc...) I am sure you work a lot, so thanks for so much for you program. I used it<br>
now and works, it is super good, look, but if the config could be add by<br>
hand or valid JSON it would be so much good:<br>
[image: Inline image 1]</p>
<p>Take care, and thanks again!<br>
Bye,<br>
Patrik</p>
<p><em>Patrik</em> WWW <a href="https://patrikx3.tk">https://patrikx3.tk</a> | GitHub <a href="https://github.com/patrikx3/">https://github.com/patrikx3/</a> | NPM<br>
<a href="https://www.npmjs.com/%7Epatrikx3">https://www.npmjs.com/~patrikx3</a> | Corifeus <a href="https://corifeus.tk">https://corifeus.tk</a> | +36 20<br>
342 8046</p></div>alabardtag:support.pimpmylog.com,2013-12-07:Comment/432953452017-09-01T19:55:51Z2017-09-01T19:55:51ZGenerating statistics<div><p>Ciao! How are you? I fixed it in a hackish fix, but it would be good if it was real JSON for the settings, because totally not JSON.<br>
Somehow in PHP and some helpers that change that data, but it is not JSON and it is very hard to work a hacked settings, when every one uses JSON (Owncloud, NextcLoud, phpMyAdmin, Roundcube, etc...)<br>
I am sure you work a lot, so thanks for so much for you program. I used it now and works, it is super good, look, but if the config could be add by hand or valid JSON it would be so much good:</p>
<p><img src="https://cdn.pbrd.co/images/GIoBr6l.png" alt="alt text" title="Hacked JSON"></p>
<p>Take care, and thanks again!<br>
Bye,<br>
Patrik</p></div>alabardtag:support.pimpmylog.com,2013-12-07:Comment/432953452017-09-02T17:41:27Z2017-09-02T17:41:27ZGenerating statistics<div><p>Congrat's for finally finding a workaround.</p>
<p>The problem is that the PHP json_encode function escapes slashes by default. This behavior is described in the json RFC. But it is not mandatory...</p>
<p>There is an option since PHP 5.4 to disable this behavior in the encode function.</p>
<p>But if you do not escape slashes, it should not be a problem ? Given that there is no option in json_decode about escaped slashes.</p></div>potskytag:support.pimpmylog.com,2013-12-07:Comment/432953452017-09-02T17:51:02Z2017-09-02T17:51:02ZGenerating statistics<div><p>Well, I have never seen slashed JSON, I guess it works with something that is RFC, but I never seen, I could only did it with hand crafted, without JSON, besides I created in NodeJs, since these days I use that. But I am happy it works and I know how to do it in the future...</p>
<p>The Pimp My Log is awesome, good job!</p></div>alabardtag:support.pimpmylog.com,2013-12-07:Comment/432953452017-09-02T17:53:01Z2017-09-02T17:53:01ZGenerating statistics<div><p>Maybe long ago in a far galaxy ... :) :) :)<br>
Have a good day!<br>
Ciao!<br>
Bye!</p></div>alabard