Skip to content

Advanced Log Configurations

All latest HyWorks Controller setup, displays option to configure SQL Server as log database but if any deployment is running older version of HyWorks Controller which does not support to set SQL Server for log database, below sub-section can be used:

Using SQL Server for HyWorks Logs

Note:

  • This is manual process requires HyWorks Controller Service restart and should be done under the supervision of Accops Support Team

  • Necessary backups of configuration files should be taken for faster restoring if any problematic effects are observed

  • Configurations are required on both Controller servers if HyWorks cluster is configured

Recommended:

  • It is recommended to install another SQL Instance for logging. Configure HyWorks Controller database and logging both on same instance could lead to performance degradation.

Configuration Steps to Change the Logs Server

Pre-requisites:

  • Another instance of SQL Server must be created for logging. To create another database instance, run the SQL installer again and follow the installation process.

Configuration Process:

  1. Open Microsoft SQL Server Management Studio and Connect using appropriate administrator credentials to the newly created SQL Server instance to be configured as Log server

  2. Open a new SQL query and paste the following queries to create a new logs DB

    CREATE DATABASE LOGDB

    GO

  3. Now new database is created, run the following query to create appropriate tables in LOGDB

    USE LOGDB
    GO

    CREATE TABLE [Log] (
    [LogId] bigint IDENTITY (1,1) NOT NULL
    , [Date] datetime NOT NULL
    , [Level] nvarchar(100) NOT NULL
    , [Logger] nvarchar(100) NOT NULL
    , [Message] ntext DEFAULT NULL NULL
    , [StackTrace] ntext DEFAULT NULL NULL
    , [StackTraceDetail] ntext DEFAULT NULL NULL
    , [ORGID] nvarchar(128) NOT NULL
    , [UserName] nvarchar(128) NOT NULL
    , [SenderHostName] nvarchar(255) NULL
    );
    GO
    ALTER TABLE [Log] ADD CONSTRAINT [PK_Log] PRIMARY KEY ([LogId]);
    GO

  4. SQL Server is ready to be configured in HyWorks Controller.

  5. Connect to HyWorks Controller Server system using remote desktop connection or console session (if in HA, first connect to secondary HyWorks Controller server)

  6. Go to HyWorks Controller Installation location (default installation path is mentioned below)

    C:\Program Files (x86)\Accops\HyWorks\Service

  7. Locate the configuration file EDC.Service.exe.config

  8. Copy the file and paste it as some safe location for backup

  9. Download the EncryptDecryptAppConfigFile tool (Please ask the Accops support team for the download link)

  10. Copy the tool on HyWorks Controller Server installation folder, default installation path is

    C:\Program Files (x86)\Accops\HyWorks\Service

  11. Run the tool with admin privileges and browse the EDC.Service.exe file and click on button Decrypt Config

    Default Location is

    C:\Program Files(x86)\Accops\HyWorks\Service\EDC.Service.exe

  12. It will decrypt the EDC.Service.exe.config file for next operation

  13. Open the EDC.Service.exe.config with WordPad

  14. In ConnectionStrings section, locate the connection strings for LogsDBContext which should be like the below screenshot

  15. Replace it with the following Connection String
    > \<add name=\"LogDBContext\" connectionString=\"Data Source=\<ServerAddress or FQDN>\sqlexpress<Instance name>,1433;Initial Catalog=LOGDB<Database name>;User ID=sa;Password=password\@123;Encrypt=False;Min Pool Size=100;Max Pool Size=500;Pooling=true;TrustServerCertificate=False;MultipleActiveResultSets=true; \" providerName=\"System.Data.SqlClient\" />

    1. Please note the highlighted sections should be changed as per SQL Server instance configurations, the configurations are

    2. SQL Server Address

    3. SQL Server Instance Name

    4. SQL Server Static Port to be used(Default port 1433, if port used different than 1433 then need to update in connection string)

    5. User Id: to be used to connect to SQL Server

    6. Password: User password

  16. Save the file

  17. Run the tool with admin privileges and browse the EDC.Service.exe file and click on button Encrypt Config

    Default Location is

    C:\Program Files (x86)\Accops\HyWorks\Service\EDC.Service.exe

  18. Open Services (Open Run Prompt, type Services.msc and press Enter)

  19. Locate and select Accops HyWorks Controller Service and click on Restart link

  20. Accops HyWorks Controller Service will get restarted and will now start sending the logs to configured SQL Server

  21. Perform couple of activities on HyWorks Controller Management Console, go to Logs section and verify if appropriate logs entries are being created

Note

Old logs will not be moved to the new SQL Server but will remain in previous embedded logsdb, the location of the file is:

  • C:\Program Files (x86)\Accops\HyWorks\Service\Logs

Alternate way of Configuring Syslog Server

Like above section, where HyWorks Controller server was not having option during installation to change log database to SQL Server, but the same configurations can be done externally, syslog server configurations were also not supported in older version. To configure syslog server externally following steps can be followed:

  1. Connect to HyWorks Controller Server system using remote desktop connection or console session (if in HA, first connect to secondary HyWorks Controller server)

  2. Go to HyWorks Controller Installation location (default installation path is mentioned below)

    C:\Program Files (x86)\Accops\HyWorks\Service

  3. Locate the configuration file log4net.config

  4. Update syslog server IP and port in log4net.config

    • In log4net.config find appender with name \"RemoteSyslogAppender\" (See screenshot below for reference)

    • Set Syslog Server`s IP address and Port as per highlighted section below in

    log4net.config

    <appender name="RemoteSyslogAppender" type="log4net.Appender.RemoteSyslogAppender">

    <identity value="HyworksController"/>

    <layout type="log4net.Layout.PatternLayout">

    <conversionPattern value="%level %property{USERNAME} %property{ORGNAME} %message %exception %property{ORG_ID} %logger" />

    </layout>

    <remoteAddress value="ServerIP" /> < --Syslog server IP address-->

    <remotePort value="514" /> <--default port 514-->

    </appender>

  5. Enable Syslog Appender: In the log4net.config file, at the bottom, in root section -> Add following Appender xml node in \<root>

    log4net.config: root section

    <appender-ref ref="RemoteSyslogAppender" />

    <root>

    <level value="INFO" />

    <appender-ref ref="UdpAppender" />

    <appender-ref ref="RemoteSyslogAppender" />

    </root>

  6. Save the log4net.config file

  7. Open Services (Open Run Prompt, type Services.msc and press Enter)

  8. Locate and select Accops HyWorks Controller Service and click on Restart link

  9. Accops HyWorks Controller Service will get restarted and will now start sending the logs to configured syslog Server

Note

  • The configuration is tested with CentOS based rsyslog server. If any issues are observed after configuration, please contact Accops Support team.

  • It requires UDP based syslog server, as the controller supports only UDP based communication with syslog server.

3.3 GA upgrade on embedded log database

After upgrade controller with 3.3 GA which having embedded log database, there need manual intervention to start logging.

Reason: In embedded log database, Controller installer skip to update DB file, because of it is loss of existing logs and existing log db file missing new column.

Solution: Contact Accops Support for help. - Download any SQL Server Compact Edition Viewer and install it.

  • Open application and Go to File -> Open database

  • Goto below location and select logdb.sdf

    C:\Program Files (x86)\Accops\HyWorks\Service\Logs

  • Select ServiceLog.sdf and enter password.

  • Check allow editing is enabled

  • Open query editor.

  • Copy below query and paste in query editor

    ALTER TABLE [Log] ADD [SenderHostName] nvarchar(500) NULL;

    GO

  • Execute query.

  • Check query is executed successfully.

  • If SenderHostName column already exist in log table then it will get failed.

Advance Configuration

Refer section Advance Configuration for log for below settings:

  • Log Remover Control

  • Log Remover Threshold

  • UDP Log Listener Port

  • Log Remover Interval

  • Enable Tracing

  • Controller Session Monitoring