networkoptix / nx_open

NetworkOptix open-source components used to build Powered-by-Nx products including Desktop Client for Network Optix Video Management Platform.
https://networkoptix.com
48 stars 18 forks source link

plugin logs not printed to nx log #9

Open shahargli opened 2 weeks ago

shahargli commented 2 weeks ago

Hello,

I built nx meta's: metadata_sdk\samples\sample_analytics_plugin\src\nx\vms_server_plugins\analytics\sample and as instructed, done this:

define NX_DEBUG_ENABLE_OUTPUT true

include <nx/kit/debug.h>

However, although the plugin is enabled and running, the logs it is producing (for example, the one at: Engine::Engine) does not shows up in main.log nor in system.log OS: Windows10 nx meta version: 6.0.0.39503-df7e87870276-metavms

Grey-DeMonstr commented 2 weeks ago

@shahargli which instruction are you referring to? As I can see, this define should make logs to be printed to stdout, not to the server logs.

shahargli commented 2 weeks ago

thanks for the reply! I am running on windows, so I cannot view the service stdout. Is there a way to redirect stdout to a file for proper debug on windows?

Grey-DeMonstr commented 1 week ago

@shahargli Sorry for the delay. Yes, there is a way: create special files in the ini-config catalog. This catalog is defined as following:

  1. %NX_INI_DIR%\ (if such environment variable is defined), or
  2. %LOCALAPPDATA%\nx_ini\ – typically, C:\Users\\AppData\Local\nx_ini\ (when running under current user), or
  3. C:\Windows\System32\config\systemprofile\AppData\Local\nx_ini\ (when running server as a service).

In this catalog you should create files mediaserver_stdout.log and mediaserver_stderr.log (where mediaserver is the name of the exe file).