How to enable tracing for HTTP In / Out calls in Sage X3

Hi readers, today we are going to look how you would enable http tracing for Syracuse. It quite easy on newer versions of Sage X3 but it can be a bit tricky for older versions like Version 7 or 8. We will look at both ways to do it.

We will start with the easier way as most people are on newer versions of Sage X3 like later patch levels of Version 9, Version 11 and Version 12.

Before we start, you will need a user who has access to the administration module. Once you’re logged in you’re going to want to navigate to Administration, Administration, Settings, Global settings.

It should look similar to my function here:

You’re going to click Edit from the right list and scroll down until you see a grid labeled “Server logs”. In this grid you can see all the additional tracing that can be enabled at the Syracuse level. Your going to want to locate the HTTP section (outlined below).

You’re going to expand that section out and you can see the default settings are set to error. This means that it will only record errors with http in/out. If you would like to see what exactly is going on, change it to Debug or Silly. Just remember, enabling anything beyond error will drastically increase log file sizes.

 

In my example here, I am going to set the logs to Debug mode to demonstrate what the logs will look like. After you make your changes don’t forget to click Save when you are done.

 

Now all you have to do is sign out and back in again to see if the log picked up anything. I am not going to go into how to locate the logs, but they will be added to the existing Syracuse log files in your Syracuse install directory.

The Syracuse logs should show the additional http calls now just like my logs show.

Don’t forget to disable the added tracing once you locate what you needed. The logs will grow very large if left unattended for a while and you don’t want to run out of hard drive space.

 

Now we will take a look at the older way of enabling HTTP tracing in Syracuse. This older way requires you to edit the nodelocal.js file. This file is essentially the configuration file for Syracuse. It is read and loaded at the time the service starts up. What this means is, making changes to this file requires the Syracuse services to be restarted for the Syracuse component to recognize the changes to the file.

Lets have a go at it.

Traditionally, before you modify the nodelocal.js, you will want to make a backup of it. Because, if you thoroughly mess up the file, you will never be able to start Syracuse. So make a copy and store it somewhere safe. You can find the nodelocal.js in the ..\Syracuse\bin.. directory. You can open it with any text editor, I prefer notepad++ mainly for the formatting but any will do.

Your nodelocal.js, when opened, should look similar to mine. It may not be exactly the same as the different versions/patches can alter the appearance and arrangement of the subsections.

 

Now scroll down to the very bottom of the list. This is where we will be adding some addition coding.

 

Here you need to add a coma to the end bracket of the “x3fusion” subsection and then hit enter to where we will enter our need additions.

Its very important to make sure to add the coma. The separator helps to distinguish the ending of a section and the start of a new.

Now the hard part. You have to add the “traces” subsection just as I have it written.

So I know that’s a lot to copy and retype so its also included below:

                "traces":{

                "http": true, //  log http requests: SYRACUSE REQUEST & RESPONSE

        //Tracer configuration

                                "config" : {

                                                // Memory tracer configuration

            "memory" : {

                                                                // Check interval for the memory tracer in minutes

                                                                // Default value : 5 (minutes)

                "checkInterval" : 1

                                                },

                                                // Http tracer configuration

                                                "http": {

                                                                // Filter the incoming request to trace only the request matching with this regular expression

                                                                // To trace all set filter:null

                                                                // Default value : (html|public|syracuse-react|syracuse-ui)

                                                                "filter" : /\/(html|public|syracuse-react|syracuse-ui)\//

                                                }

                                }

                }

 

That should save some time in the copy process…

Anyhow... Make sure to SAVE your changes. Once saved you will have to restart the Syracuse services to get it to pickup the new changes added to the nodelocal.js

Pro tip: if the services do not start, or do not stay started then you typed in something wrong or missing the punctuation. Double check.

If all goes as planned the Syracuse logs should look like this.

You can see that they look just like the V11 ones I showed early with one exception. Instead of http.in and http.out it says Syracuse request and Syracuse response.

 

And there you have it. Two ways to enable http logging for Sage X3.

Until next time readers…

Anonymous