Home Forums Administration How to See a running service logs in Admin page?

Viewing 3 reply threads
  • Author
    Posts
    • #423
      ashutoshashutosh
      Participant

      Hi Team,

      I have a made a service in NexJ. Which picks the files and process it? I want to see all the logs of the running service in the Admin page. Currently I am running the service in my local nexj studio and I see the logs in the eclipse console. What steps do I need to follow to see the running process logs in the admin page.

      Please refer the screen shot.

      Regards,
      Ashutosh

      0
      Attachments:
      You must be logged in to view attached files.
    • #425
      Ed ShawEd Shaw
      Keymaster

      Without code to support it, the only build in tracking of your service will be statistics indicating the number of messages sent or received over bound channels.

      You have a few options to instument your code. First a few concepts:

      1) the logger function allows you to output information to the logs

      2) the SysProcess and related classes let you log activity to the Process tab of the Admin Console

      3) statistics allow you to instrument your code and make it available in the Statistics Tab of the Admin Console and also via JMX

      logger – See the logger help for information on this function. To read this, hover your mouse over “(logger” in a scratchpad. The logger will simply output the information you provide to log4j at the appropriate level. When running in NexJ Studio, you will see the output in the console. When running on a server the output will go to your server log files. Their location, name, rollover, etc. are controlled by log4j settings and will not be visible in the Admin Console.

      SysProcess – To instrument your code to show status in the Process tab of the Admin Console, include something like this:

      statistics – I don’t think this is what you are looking for so will go into statistics in a future article. Out of the box (in Jade) you can see channel statistics in the Statistics tab of the Admin console or attach to the JMX counters as described in https://community.nexj.com/featured-posts/2015/09/29/setting-up-remote-jmx-monitoring-with-mission-control-eclipse-plug-in/.

      1
    • #430
      ashutoshashutosh
      Participant

      Thank you very much Ed. I was looking exactly for this info you provided 🙂

      Now I have to see how can I have the logger and SysProcess in my service implemented.

      Regards,
      Ashutosh

      0
    • #432
      Ed ShawEd Shaw
      Keymaster

      So you will likely want to:

      – create a variable on your service called something like process. This is done using the variables property on the service.

      – add an initialization (script) step at the beginning and set the ‘process’ variable to a SysProcess instance. e.g.

      – whenever you are logging something in your code, wrap it in the (with-logger function. This means you shouldn’t use the Log step, you need to log using the (logger function in code.

      – add a final step that will set the process status to COMPLETED as above.

      0
Viewing 3 reply threads
  • You must be logged in to reply to this topic.