HTTP "listener" Log Manager

Here developers can talk about how to write a Manager for LogMX

Moderator: admin

Post Reply
jobemakar
Posts: 22
Joined: Thu Jun 11, 2015 9:49 pm

HTTP "listener" Log Manager

Post by jobemakar » Mon Dec 11, 2017 4:36 pm

Hi - TCP isn't natively supported in the browser (outside of the Flash Player). We deploy our game clients to the browser and need to receive logs in realtime directly from a game client to LogMX. We use TCP for this when using Flash games or any game deployed to mobile. But with Unity or any other non-Flash browser games TCP is not an option.

So, I think we can solve this by adding a HTTP log manager that is able to receive log entry additions. The log manager would I guess have to spin up a light weight web server for receiving these additions.

Does something like this exist? If not, it seems like it would be a useful addition to your log manager list as it would work for any browser-based app.

admin
Site Admin
Posts: 437
Joined: Sun Dec 17, 2006 10:30 pm

Re: HTTP "listener" Log Manager

Post by admin » Wed Dec 13, 2017 2:00 am

Hello,

Good idea. But I guess the way to implement this HTTP listener depends on your needs: raw HTTP GETs/POSTs, REST API style with JSON log entries in the body, log entries put inside the HTTP request URL, ... So depending on this, you may want to use: the basic JDK HTTP features, or a richer framework like Jetty, NanoHttpd, or Apache HTTP Components. All these solutions seem easily feasible in a LogMX Log Manager.

I would be curious to know, in your case, what your needs are. Maybe we can find a set of features that would cover most of people's needs.

Also, if you have purchased a Premium license, we can build a Log Manager that will perfectly fit your needs (Log Manager built just for you).

Xavier

jobemakar
Posts: 22
Joined: Thu Jun 11, 2015 9:49 pm

Re: HTTP "listener" Log Manager

Post by jobemakar » Thu Dec 14, 2017 4:16 pm

Hi Xavier, thanks for the response!

Let me explain the need. I think most of the log managers read logs from some external source. Like a local file, or a file found at some FTP, SCP, or HTTP location. But in our case we develop game clients. These clients can run locally during dev, on a mobile device, or in the desktop browser. The biggest use of logging for us is during development and to be read by a developer. We prefer to receive logs in realtime as the app is used. This allows us to us to use the app, navigate through it, and view-and-interpret logs in realtime using LogMX.

We've been doing this successfully for a few years now with LogMX using a custom TCP log manager what we wrote. LogMX listens over TCP on a port. Our client connects to that port and sends logs to it one entry at a time as the application logs it.

Why this won't work for us going forward is because the Flash Player is dying. So TCP support in the browser dies with it. That leaves us with either WebSocket or HTTP. HTTP is more flexible.

We do have a premium 50 seat license (High 5 Games). I would certainly like to hear what you could do for us. Email is jobe dot makar at high5games.com. Just message me here that you've emailed me so I can be sure it wasn't filtered out.

admin
Site Admin
Posts: 437
Joined: Sun Dec 17, 2006 10:30 pm

Re: HTTP "listener" Log Manager

Post by admin » Fri Dec 15, 2017 4:42 am

Hello,

I just sent you an e-mail to get more details about the Manager to implement for you :)

Xavier

jobemakar
Posts: 22
Joined: Thu Jun 11, 2015 9:49 pm

Re: HTTP "listener" Log Manager

Post by jobemakar » Tue Feb 06, 2018 2:08 am

Note to anyone else reading this. Xavier did a great job on this and it meets our need perfectly!

admin
Site Admin
Posts: 437
Joined: Sun Dec 17, 2006 10:30 pm

Re: HTTP "listener" Log Manager

Post by admin » Tue Feb 06, 2018 3:44 am

:D

jobemakar
Posts: 22
Joined: Thu Jun 11, 2015 9:49 pm

Re: HTTP "listener" Log Manager

Post by jobemakar » Tue Feb 27, 2018 2:41 am

Xavier - I've been using this successfully locally. But now that I'm logging from the browser to LogMX, I have run into this security restriction:
Failed to load http://localhost:8080/logmx: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:51849' is therefore not allowed access.

I think I mentioned via email that we might run into that. Could that header be enabled?

admin
Site Admin
Posts: 437
Joined: Sun Dec 17, 2006 10:30 pm

Re: HTTP "listener" Log Manager

Post by admin » Tue Feb 27, 2018 3:50 am

Hello,

Sorry my bad, I forgot about that. My initial idea was to use the config file "<LogMX_Dir>/config/managers.properties" to list the headers you want the HTTP server to return, so that you don't need our help to add/update/remove headers. Since this file can be used for other Manager settings, I suggest the prefix "http.server.header". Here is an example:

Code: Select all

http.server.header.Access-Control-Allow-Origin = *
http.server.header.Content-Type = text/plain
http.server.header.X-My-Custom-Header = my value
Can I send you a patch for LogMX v6.1.1? If you're using an older version (and don't want to -or cannot- update right now), please let me know which one you're using so that I can provide you with the proper patch (the modification will be easy and fast, just a business day, and then of course it will be also included in the next releases)

Xavier

jobemakar
Posts: 22
Joined: Thu Jun 11, 2015 9:49 pm

Re: HTTP "listener" Log Manager

Post by jobemakar » Tue Feb 27, 2018 1:51 pm

Thanks Xavier, that sounds fine. I'm using v6.0.301. However, I don't mind updating to the latest stable either.

admin
Site Admin
Posts: 437
Joined: Sun Dec 17, 2006 10:30 pm

Re: HTTP "listener" Log Manager

Post by admin » Wed Feb 28, 2018 1:47 am

I just sent you an e-mail containing a link for the patch to apply (cannot post this Pro version here :wink:)

jobemakar
Posts: 22
Joined: Thu Jun 11, 2015 9:49 pm

Re: HTTP "listener" Log Manager

Post by jobemakar » Wed Feb 28, 2018 2:00 am

Strange - I did not receive it. I checked the spam folders too. I'll email you directly.

admin
Site Admin
Posts: 437
Joined: Sun Dec 17, 2006 10:30 pm

Re: HTTP "listener" Log Manager

Post by admin » Wed Feb 28, 2018 2:25 am

Mail re-sent. I replaced the base URL of our website with XXXXX, I guess your mail server doesn't like URLs ending with ".jar" (which could make sense!)

Post Reply