I am working on spinning up a new installation of GenieACS 1.2 due to its automation abilities. At this time, I’m working on an extension script and I am not being successful in getting it to log debugging information anywhere.
GenieACS is installed on a Ubuntu 19 server utilizing the recommended installation method from the GenieACS docs. Therefore, my extension scripts are located in /opt/genieacs/ext. In order to make any libraries load, I created the directory /opt/genieacs/lib and placed a copy of all the libraries in this location.
The first problem is I am unable to load the logger with require("…/lib/logger"); I must specify the full “/opt/genieacs/lib/logger” path. Even then, occasionally, the script will error out with the message:
Channel has faulted; channel=“test” retries=0 faultCode=“ext.Error” faultMessage=“Cannot find module ‘/opt/genieacs/lib/logger’”
I can clear the fault and re-trigger the script and it will work fine the next time. Should I not be using the GenieACS logger library and use a NodeJS logger library instead?
2nd, when the logger does load and the script runs, there is no log output anywhere. I’m sure this is a noob question, but how do I make the extension log to a file so I can debug and know what is happening?
I was able to get this working in v1.2 by using console.log and using journalctl in follow mode (-f) against the genieacs-cwmp daemon (-c genieacs-cwmp) to view the extension messages. Thanks for the poke in the proper direction.
Hi Eric,
I too am having the same issue of not seeing the log message from the extensions.
I am using v1.2
I am running the extension script described in the documentation: http://docs.genieacs.com/en/latest/extensions.html
and I’ve added one “console.log” to test the logging from the extension.
“use strict”;
const http = require(“http”);
let cache = null;
let cacheExpire = 0;
function latlong(args, callback) {
if (Date.now() < cacheExpire)
return callback(null, cache);