Anyone have thoughts on best practices to share sc...
# suitescript
s
Anyone have thoughts on best practices to share script logging externally (to non-Netsuite users)? The use case is that we have engineers who work on applications that integrate with Netsuite by calling various Restlets. Those engineers have to go on call to support their applications, but since they do not have Netsuite access in production, all restlets issues end up coming in to a very small group of people, including myself. I am trying to think of a better way to logs alert or errors so that non-NS users could easily search them without using up a Netsuite license.
n
I'm also interested in other people's approach to this. I was kind of shocked that there is no real log shipping option out of NetSuite.
s
ship log data externally to a service such as logz.io, loggly, similar.
c
I’d probably have a scheduled script that chucks logs over to kibana every 15 mins. Now that you’ve said this, I'm going to implement it tomorrow. All of our k8s/Java/php already log to kibana, so it makes sense
e
I do not have experience with this scenario but could you create a saved search with specific filters, then through other restlet return the necessary logs, you could pass parameters such us; start date, end date, script id, etc.
s
@eminero that was actually my initial thought, and probably workable. We are in the process of switching logging and alerting tools now, which is why I began thinking about it.
c
If anyone has a specific logging target system in mind, I'm happy to write something and open source
s
I'd be wary in general about shipping logs out of an NS account without their explicit consent/permission
s
And yeah, my other thought was a scheduled or M/R script that dumped any logs to an external service. I could probably write them to an SFTP server then have a process read those into our logging tool, that way if we change logging services, I don’t have to rewrite the code.
@Sandii well, these are my logs. In other words, logging statements written by my code, from my scripts. Why would I not be able to export them?
I wouldn’t be doing some mass export of all script logs, just our integration restlets. Very targeted for a particular audience.
s
It's data in their system, so it might technically be their data, not yours? I don't know the details or if anyone would care, just something to consider.
s
he is the customer @Sandii
or at least, that's my understanding
s
Oh, should probably mention, I work for the company, not a contractor.
s
Makes a lot more sense
s
I was thinking you meant Netsuite might not permit the export of the data.
Yeah, this would be logging to some SFTP server or logging service owned or leased by the company, so other employee on other teams could have access.
So often, the restlet errors are due to bad inputs, and I am alerted, just to log in so I can tell them they sent bad data.
s
I have a little experience with this. Logged them in CSV files and pushed to a server. 2nd solution was to just update a google doc
s
I'd have a M/R script pull filtered log data and push to the logging service to have reasonably recent data in the centralized system
👍 1
s
Thanks for all the suggestions. I’m taking them all into consideration for when we finally settle on a new logging service. I still don’t know what it will be yet, or what kind of API it will have.
s
@scottvonduhn I'd ask if they own the input, if they do, let them query for errors today/the logs via the restlet that'll output/transform the saved search otherwise it'd be sftp, or if you run M/R behind it, a summary stage email would do too?
s
My concerns with a restlet that can return errors are that, unlike with most external logging solutions, we can’t easily build alerting around that. It requires frequent polling of Netsuite for data that may or may not be there. Also, the script logs will be lost after 30 days or sometimes sooner. I think pushing to an external logging service may be the better option, and provides additional benefits, like alerting, and the ability to keep the logs for more than 30 days. I could do email alerts too
e
Out of curiosity, is there any settings to keep logs for more than 30 days or is it a standard restriction?
s
I haven't seen a setting to control log lifetime
👌 1
I still recommend @scottvonduhn you have a background process that ships logs to an external logging service designed for exactly what you need. Hopefully it's the same service used elsewhere in your org and hence can provide centralized features.
s
@stalbert Yes, that’s the plan. It’s far better to have logs from all of our apps and services in one place. Makes tracking down issues easier.
💯 1