Jump to content

[HELP] Show console logs on the web using PHPSDK


AaroN⍩

Recommended Posts

Posted

Hi, I hope someone can help me with this question, I would like to display the latest server logs on a website using PHPSDK but I have a question on how to do it efficiently as it will update in real time. any ideas?

 Full Stack Developer - Security Servers :druid:

  • MTA Team
Posted

Do you have a custom server log system? What type of logs do you wish to sync? Have you tried using a service like webmin/docker and some kind of log shipper?

DevOps Engineer, Cloud Advocate & Security Engineer(Red Team) | Coffee, Containers & Burp

 
Posted
On 22/08/2020 at 01:27, AaroN⍩ said:

Hi, I hope someone can help me with this question, I would like to display the latest server logs on a website using PHPSDK but I have a question on how to do it efficiently as it will update in real time. any ideas?

I'm not sure if it's possible to achieve real time with just PHP.
Maybe you can use socket that can be listened with javascript client.

  • Moderators
Posted

You can open a file handle on server.log and read it periodically. Move the pointer to end of file after opening it initially, and read from it at some interval (500ms should feel like realtime).

Posted

other sol you can use ajax but it's not that good idea

Skype 01100001 01101100 01101001 01011111 01101101 01110100 00110001 00111001 00111001 00111001

every thing is gonna be alright

every thing is gonna be okay

it's gonna be a good good life

that's what my therapist say

  • 3 months later...
Posted
On 28/08/2020 at 09:37, Zango said:

You can open a file handle on server.log and read it periodically. Move the pointer to end of file after opening it initially, and read from it at some interval (500ms should feel like realtime).

Initially I did it like this, but it is not efficient since you have to count the lines of the server.log and then take the last 20 lines, for example, and do it every 5 seconds is 0 efficient.

 Full Stack Developer - Security Servers :druid:

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...