RSS   Twitter   Copiny   Copiny
Нашел ошибку? 

Выдели фрагмент текста с ошибкой или неточностью и нажми Ctrl+Enter!

Логирование сообщений в файл через JBDump

Логирование сообщений в файл

Бывают случаи когда значение переменной легче посмотреть в файле логов, чем в браузере. Например, узнать, что происходит когда на сайт заходит бот оплаты, который передает фоновое сообщение от сервиса к сайту, что оплата успешно прошла.

Это предусмотренно в JBDump, смотрим пример:

JBDump::log($var['bool'], 'Boolean');
JBDump::log($var['integer'], 'Integer');
JBDump::log($var['float'], 'Float');
JBDump::log($var['string'], 'String');
JBDump::log($var['stdClass'], 'stdClass');

// отдельный логгер, который запишет сообщение в отдельный файл с префиксом "newlogger"
JBDump::i('newlogger')->log('Hello world!'); 

В лог запишется следующая информация

2011-09-04 11:19:35 81.201.254.108 log.php:17 Boolean TRUE
2011-09-04 11:19:35 81.201.254.108 log.php:18 Integer 10
2011-09-04 11:19:35 81.201.254.108 log.php:19 Float 100.5
2011-09-04 11:19:35 81.201.254.108 log.php:20 String 10 123 34
2011-09-04 11:19:35 81.201.254.108 log.php:22 stdClass {"property":"Property value"}
2011-09-04 11:19:35 81.201.254.108 log.php:23 simpleObject {"simpleVar":"simple var","publicVar":"public var"}

Сложные объекты сериализуются, по умолчанию через print_r. В настройках можно задать способ сериализации.

Файлы логов закрыты от посторонних глаз

Стоит заметить, что по умолчанию все файлы логов защищены от чтения по прямой ссылке. Такм образом не смотря на то что файлы лежат в открытом виде, прочитать их не получится.

Пример шапки лога:

#<?php die('Direct Access To Log Files Not Permitted'); ?>
#Date: Thu, 24 Nov 11 03:43:41 +0600
#Software: JBDump v1.2.6
#datetime    client_ip        file        name        text

Смотрите также:
Комментарии (43) Добавить комментарий
  • http://tinyurl.com/quest-bars-cheap-44820
    http://tinyurl.com/quest-bars-cheap-44820
    24 Ноября 2019, 02:35
     ↑  0  ↓     ответ

    As the admin of this website is working, no doubt very

    rapidly it will be renowned, due to its quality

    contents.

  • http://tinyurl.com
    http://tinyurl.com
    24 Ноября 2019, 15:02
     ↑  0  ↓     ответ

    Thank you for sharing your thoughts. I really appreciate your efforts and I will be waiting for your next write

    ups thanks once again.

  • coconut oil or
    coconut oil or
    26 Ноября 2019, 03:29
     ↑  0  ↓     ответ

    First off I want to say superb blog! I had a quick question that I'd like to ask if you do not

    mind. I was interested to find out how you center yourself and clear your thoughts prior

    to writing. I've had a hard time clearing my thoughts in getting my thoughts out.

    I do enjoy writing but it just seems like the first 10 to 15 minutes

    are usually lost just trying to figure out how to begin. Any suggestions or

    tips? Thank you!

  • plenty of fish dating site
    plenty of fish dating site
    26 Ноября 2019, 10:08
     ↑  0  ↓     ответ

    Thanks for a marvelous posting! I really enjoyed reading it,

    you're a great author. I will make certain to bookmark your

    blog and will come back in the future. I want to encourage

    that you continue your great posts, have a nice day!

  • ps4 games
    ps4 games
    29 Ноября 2019, 08:29
     ↑  0  ↓     ответ

    I couldn't refrain from commenting. Exceptionally well written!

  • quest bars cheap
    quest bars cheap
    30 Ноября 2019, 17:04
     ↑  0  ↓     ответ

    Great weblog right here! Additionally your site a lot up very fast!

    What web host are you the use of? Can I get your affiliate link

    to your host? I wish my website loaded up as quickly as yours lol

  • quest bars cheap
    quest bars cheap
    02 Декабря 2019, 03:49
     ↑  0  ↓     ответ

    I am really grateful to the owner of this web site who has shared this great paragraph at at this place.

  • quest bars cheap
    quest bars cheap
    02 Декабря 2019, 16:45
     ↑  0  ↓     ответ

    I’m not that much of a internet reader to be honest but your blogs really nice, keep

    it up! I'll go ahead and bookmark your site to come back

    later on. Cheers

  • quest bars cheap coupon twitter
    quest bars cheap coupon twitter
    03 Декабря 2019, 02:04
     ↑  0  ↓     ответ

    This is a topic which is close to my heart... Best wishes!

    Exactly where are your contact details though?

  • quest bars cheap coupon twitter
    quest bars cheap coupon twitter
    04 Декабря 2019, 05:03
     ↑  0  ↓     ответ

    Quality content is the crucial to invite the users to pay a quick visit the website,

    that's what this site is providing.

  • quest bars cheap
    quest bars cheap
    04 Декабря 2019, 07:11
     ↑  0  ↓     ответ

    Very descriptive article, I loved that bit. Will there

    be a part 2?

  • ps4 games
    ps4 games
    05 Декабря 2019, 04:09
     ↑  0  ↓     ответ

    Why users still use to read news papers when in this technological

    globe the whole thing is existing on net?

  • ps4 games
    ps4 games
    06 Декабря 2019, 02:37
     ↑  0  ↓     ответ

    I'm amazed, I have to admit. Seldom do I come across

    a blog that's both equally educative and amusing,

    and let me tell you, you have hit the nail on the head.

    The problem is something too few men and women are speaking intelligently about.

    I'm very happy that I came across this during my search

    for something regarding this.

  • ps4 games
    ps4 games
    06 Декабря 2019, 11:33
     ↑  0  ↓     ответ

    Wonderful post! We will be linking to this great article on our website.

    Keep up the good writing.

  • ps4 games
    ps4 games
    06 Декабря 2019, 22:34
     ↑  0  ↓     ответ

    I absolutely love your blog and find almost all of your post's to be just what I'm looking for.

    can you offer guest writers to write content for you? I wouldn't

    mind creating a post or elaborating on some of the subjects you write related to here.

    Again, awesome website!

  • ps4 games
    ps4 games
    07 Декабря 2019, 14:04
     ↑  0  ↓     ответ

    Good day! This is kind of off topic but I need some help from an established blog.

    Is it tough to set up your own blog? I'm not very techincal but I can figure things out pretty quick.

    I'm thinking about setting up my own but I'm not sure where to begin.

    Do you have any points or suggestions? Cheers

  • quest bars cheap
    quest bars cheap
    07 Декабря 2019, 16:28
     ↑  0  ↓     ответ

    If some one needs to be updated with most up-to-date technologies therefore he must be

    pay a quick visit this web page and be up to date daily.

  • quest bars cheap
    quest bars cheap
    10 Декабря 2019, 00:20
     ↑  0  ↓     ответ

    Simply wish to say your article is as astounding. The clarity in your post is simply nice and i could assume you're a professional on this subject.

    Well with your permission let me to seize your RSS feed to stay up to date with drawing close post.

    Thank you a million and please keep up the enjoyable work.

  • quest bars cheap
    quest bars cheap
    10 Декабря 2019, 10:07
     ↑  0  ↓     ответ

    Excellent way of describing, and fastidious piece of writing to get facts concerning my

    presentation topic, which i am going to deliver in school.

  • ps4 games
    ps4 games
    11 Декабря 2019, 02:18
     ↑  0  ↓     ответ

    Hello just wanted to give you a quick heads up and let you know a few of

    the pictures aren't loading properly. I'm not sure why

    but I think its a linking issue. I've tried it in two different browsers and both show the same results.

  • ps4 games
    ps4 games
    12 Декабря 2019, 06:08
     ↑  0  ↓     ответ

    Paragraph writing is also a excitement, if you be

    acquainted with then you can write or else it is difficult to

    write.

  • ps4 games
    ps4 games
    13 Декабря 2019, 16:02
     ↑  0  ↓     ответ

    My brother suggested I might like this blog.

    He was totally right. This post actually made my day.

    You can not imagine simply how much time I had spent for this information! Thanks!

  • ps4 games
    ps4 games
    14 Декабря 2019, 05:43
     ↑  0  ↓     ответ

    These are genuinely impressive ideas in concerning blogging.

    You have touched some good things here. Any way keep up wrinting.

  • coconut oil
    coconut oil
    16 Декабря 2019, 13:59
     ↑  0  ↓     ответ

    Hi there, constantly i used to check web site posts here in the early

    hours in the morning, because i love to learn more and more.

  • coconut oil
    coconut oil
    18 Декабря 2019, 01:46
     ↑  0  ↓     ответ

    Wow, superb blog layout! How long have you been blogging for?

    you made running a blog glance easy. The total look of your site is

    magnificent, let alone the content!

  • coconut oil
    coconut oil
    19 Декабря 2019, 15:01
     ↑  0  ↓     ответ

    Hi, i think that i saw you visited my blog thus i came

    to “return the favor”.I'm attempting to find things to enhance my website!I suppose its ok to use some

    of your ideas!!

  • match.com free trial
    match.com free trial
    29 Декабря 2019, 13:07
     ↑  0  ↓     ответ

    After going over a handful of the articles on your web site, I really like your technique of writing a blog.

    I saved it to my bookmark website list and will be checking back

    in the near future. Please visit my web site too and tell me how you feel.

  • plenty of fish vs match.com free trial
    plenty of fish vs match.com free trial
    30 Декабря 2019, 23:07
     ↑  0  ↓     ответ

    I'm amazed, I must say. Rarely do I encounter a blog that's equally educative and

    entertaining, and let me tell you, you've hit the

    nail on the head. The problem is an issue that not enough men and women are speaking intelligently about.

    Now i'm very happy that I found this in my search for something

    relating to this.

  • match.com free trial
    match.com free trial
    31 Декабря 2019, 04:15
     ↑  0  ↓     ответ

    Thanks for sharing your thoughts. I really appreciate your efforts and I will be waiting for your

    further write ups thank you once again.

  • https://asksylphoflight.tumblr.com
    https://asksylphoflight.tumblr.com
    31 Декабря 2019, 17:50
     ↑  0  ↓     ответ

    Hi, i think that i noticed you visited my site thus i came

    to go back the favor?.I'm attempting to in finding issues to enhance my

    site!I guess its ok to make use of a few of your ideas!!

  • https://russellwebster.tumblr.com/
    https://russellwebster.tumblr.com/
    01 Января 2020, 08:11
     ↑  0  ↓     ответ

    Aw, this was an exceptionally good post. Finding the time and actual effort to produce a good article…

    but what can I say… I put things off a lot and

    don't seem to get nearly anything done.

  • sling tv
    sling tv
    01 Января 2020, 18:05
     ↑  0  ↓     ответ

    Oh my goodness! Incredible article dude! Many thanks, However

    I am going through difficulties with your RSS.

    I don't understand why I can't subscribe to it. Is there anybody else having similar RSS problems?

    Anyone that knows the solution can you kindly respond?

    Thanks!!

  • asksylphoflight.tumblr.com sling tv
    asksylphoflight.tumblr.com sling tv
    05 Января 2020, 10:31
     ↑  0  ↓     ответ

    Hello, after reading this amazing paragraph i am as well delighted to share my familiarity here with

    mates.

  • sling tv
    sling tv
    07 Января 2020, 09:46
     ↑  0  ↓     ответ

    I think the admin of this web page is really working hard in favor of his web page, since here

    every stuff is quality based material.

  • https://asksylphoflight.tumblr.com/ sling tv
    https://asksylphoflight.tumblr.com/ sling tv
    07 Января 2020, 18:47
     ↑  0  ↓     ответ

    A fascinating discussion is definitely worth comment.

    I do think that you ought to publish more about this subject matter, it might

    not be a taboo subject but usually people do not talk about these subjects.

    To the next! Kind regards!!

  • tinyurl.com
    tinyurl.com
    07 Января 2020, 21:58
     ↑  0  ↓     ответ

    My brother suggested I would possibly like this website.

    He was totally right. This publish truly made my day. You can not consider simply how much time I had spent for this information! Thanks!

  • sling tv
    sling tv
    14 Января 2020, 12:24
     ↑  0  ↓     ответ

    Hi there everyone, it's my first pay a visit at this web site, and paragraph is truly fruitful in support of me, keep up posting these types of content.

  • sling tv
    sling tv
    14 Января 2020, 23:58
     ↑  0  ↓     ответ

    Heya! I'm at work browsing your blog from my new iphone 3gs!

    Just wanted to say I love reading through your blog and look forward to all your posts!

    Carry on the fantastic work!

  • sling tv
    sling tv
    15 Января 2020, 14:22
     ↑  0  ↓     ответ

    Hello there, There's no doubt that your web site could be having web browser compatibility problems.

    Whenever I look at your website in Safari, it looks fine however, if opening in IE, it has some overlapping issues.

    I just wanted to give you a quick heads up!

    Apart from that, excellent website!

  • sling tv
    sling tv
    17 Января 2020, 05:30
     ↑  0  ↓     ответ

    I used to be suggested this blog by my cousin. I am no

    longer sure whether this submit is written through him

    as no one else know such certain approximately my problem.

    You are amazing! Thanks!

  • sling tv
    sling tv
    18 Января 2020, 23:12
     ↑  0  ↓     ответ

    Hey there excellent website! Does running a blog similar

    to this take a massive amount work? I've absolutely no understanding of coding but I had been hoping to start my own blog in the near future.

    Anyhow, should you have any suggestions or techniques for new blog owners please share.

    I understand this is off subject however I simply wanted to ask.

    Thanks!

  • sling tv
    sling tv
    19 Января 2020, 11:02
     ↑  0  ↓     ответ

    That is really fascinating, You're an overly professional blogger.

    I have joined your rss feed and stay up for in the hunt for more

    of your wonderful post. Also, I have shared your web site in my social networks

  • sling tv best package 2020
    sling tv best package 2020
    25 Января 2020, 00:40
     ↑  0  ↓     ответ

    Hello, I desire to subscribe for this webpage

    to obtain most recent updates, thus where can i do it

    please help.

Оставить комментарий




* обязательно для заполнения

1 введенный почтовый адрес используется только для обратной связи при ответах в комментариях и сервиса gravatar.com
.