0

Simple file network log handling



How does networked logging work on the BrightSign? I used to see periodic posts to EVENT, etc. on the web folder but it looks like it has changed on the new firmware; is there an example log handler? Are the logs cleared from time to time on the unit?

11 comments

  • 0
    Avatar
    RokuLyndon


    The logs are cleared from the unit if they're successfully posted. The unit isn't trying to ftp to put the files on your server. It is sending the information via http post. So, you need to write a log handler on your server to process the incoming posts, and store them.

    I do not have a log handler for the latest Brightauthor, just for the older 2.2 release.
  • 0
    Avatar
    Christopher Liska

    Does anyone have an example of the loghandler.php and some documentation on how to make it work with the latest version of Brightauthor. I have tried to use an example from an older 2.2 release on an internal webserver and i cannot get the logs to be transferred to the webserver from the Brightsign M1010

  • 0
    Avatar
    JRB Technical

    This would be very helpful, if someone from BrightSign could respond to this.

    BrightSign Team, any information and an example would be greatly appreciated by all!

    To give users absolutely no information on how this is supposed to work with the current BrightSign Firmware, after telling them that it will work with Simple File Networking, and reference an ambiguous loghandler.php file is not fair to your users.

    Thanks!

  • 0
    Avatar
    dholth

    This is the log handler I use (written for the Pyramid web framework). It handles POST requests to (base + event) or (base + error) etc., all tags in current-sync.xml, e.g. current-sync.xml is http://example.com/brightsign/current-sync.xml and the logs are posted to http://example.com/brightsign/EVENT.

    In the latest version of the firmware the sign does not put a / between the two parts of the URL, so I recommend making sure base has a trailing /

     

    def log_handler(request):
    log_directory = '/some/directory'
    filename = request.environ['HTTP_CONTENT_DISPOSITION'].split('filename=', 1)[-1].strip('"')
    full_filename = os.path.join(log_directory, os.path.basename(filename))

    with open(full_filename, 'w') as logfile:
        logfile.write(request.body)
        request.response.body = 'RECEIVED'
    return request.response

  • 0
    Avatar
    dholth

    By the way, I think the response body can be anything, as long as it returns a successful HTTP response code.

  • 0
    Avatar
    JRB Technical

    Thanks, that helps a little, although I am not familiar with Pyramid, but perhaps I can figure out enough to translate over to perl, which will work best for my server.

    I was hoping someone from BrightSign would chime in, but they don't seem to ever respond to peoples questions here it seems.

  • 0
    Avatar
    Lyndon

    I've attached a sample log handler.  I want to repeat what I've said more than once. While we try to be as responsive as possible to the forums, and sometimes we're not successful, the fastest and best way to get an answer is to send an email to support. 

     

    Email will always be faster than the forums. 

  • 0
    Avatar
    JRB Technical

    Thank you. After some work, I finally got it working.

    It seems there is a bug in the Simple File Networking for the Brightsign (HD220 [4.0.13]). 

    In the URL for Web Folder in the Unit Setup page, I have to leave off the last "/" in the URL for the unit to correctly check my server for updates "http://www.mywebsite.com/mybrightsign0123".

    If I leave on the last "/" in the URL, the Unit is looking for the following on the server "http://www.mywebsite.com/mybrightsign0123//current-sync.xml".
    Fortunately my server is set to correctly redirect that.

    However, if I don't use the last "/", the upload.php is being sent to the server without that as well, so what the server sees is "http://www.mywebsite.com/mybrightsign0123upload.php".

    I also tried adding the "/" before the "upload.php" in Relative URL for the Log Handler box, but it look like you parse out the "/" before the "upload.php" somewhere in the units firmware.

    Somewhere, an extra “/” is being added into the mix. I am currently using the “/” at the end of the URL, as that is what you have as your example URL, and it works for both updates and the upload script, it's just redirecting the contents of that directory when it looks for an update.

    Also, what is the player doing when trying to access the following on the server:

    "http://www.mywebsite.com/mybrightsign0123/EVENT"
    "http://www.mywebsite.com/mybrightsign0123/DEVICEERROR"

    I am seeing mainly a few  “EVENT”'s and one “DEVICEERROR” in my Error logs, as the File does not exist. This was even before I added the “upload.php” event handler script. Just curious what the units are attempting to do and what data is being sent and how for those events?

    Thank you!

    John

  • 0
    Avatar
    Lyndon

     

    The extra slash bug is an issue with the BrightAUthor software. That's being fixed now. We're testing the fix internally in version 3.2.0.8. So, the next 3.2 beta to be posted will include that fix.

     

    I'll confirm what's being sent to those urls but if there are errors during encountered on the unit, they are sent to those urls assuming that's where the logging is for unit errors. I believe that includes any errors encountered with downloads. I'll get a list of exactly what's sent to that URL. 

  • 0
    Avatar
    Chary

    Hi Lyndon, I am new to this Brightsign environment. I need to implement a loghandler(for all logs) in c# (ashx). Do you have any link for that? From above response, looks like you have attached a loghandler.php file. But i don't see it here. Please can you re-attach or send me the file to my email: chary.chilupuri@sourcexpert.com

     

  • 0
    Avatar
    Lyndon

     

    That was an old handler, from 2010. I can't provide details on it but here it is again:

    https://www.brightsignnetwork.com/download/Scripts/upload-latest.php

Please sign in to leave a comment.