Advanced Log Configurations
All the latest HyWorks Controller setup displays the option to configure SQL Server as a log database but if any deployment is running an older version of HyWorks Controller which does not support setting SQL Server for log database, the below sub-section can be used:
Using SQL Server for HyWorks Logs
Note:
-
This 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 restoration if any problematic effects are observed.
-
Configurations are required on both Controller servers if the HyWorks cluster is configured.
Recommended:
- It is recommended that another SQL Instance be installed to log in. Configuring the HyWorks Controller database and logging both on the same instance could lead to performance degradation.
Configuration Steps to Change the Logs Server
Prerequisites:
- 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:
-
Open Microsoft SQL Server Management Studio and Connect using appropriate administrator credentials to the newly created SQL The server instance is to be configured as a log server.
-
Open a new SQL query and paste the following queries to create a new logs DB.
CREATE DATABASE LOGDB
GO
-
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
-
SQL Server with database LOGDB, is ready to be configured in HyWorks Controller.
-
Connect to HyWorks Controller Server system using remote desktop connection or console session (if in HA, first connect to secondary HyWorks Controller server)
-
Go to HyWorks Controller Installation location (default installation path is mentioned below)
C:\Program Files (x86)\Accops\HyWorks\Service
-
Locate the configuration file EDC.Service.exe.config
-
Copy the file and paste it as some safe location for backup
-
Download the EncryptDecryptAppConfigFile tool (Please ask the Accops support team for the download link)
-
Copy the tool on HyWorks Controller Server installation folder, default installation path is
C:\Program Files (x86)\Accops\HyWorks\Service
-
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
-
It will decrypt the EDC.Service.exe.config file for next operation
-
Open the EDC.Service.exe.config with WordPad
-
In ConnectionStrings section, locate the connection strings for LogsDBContext which should be like the below screenshot
-
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">
-
Please note the highlighted sections should be changed as per SQL Server instance configurations, the configurations are
-
SQL Server Address
-
SQL Server Instance Name
-
SQL Server Static Port to be used(Default port 1433, if port used different than 1433 then need to update in connection string)
-
User Id: to be used to connect to SQL Server
-
Password: User password
-
-
-
Save the file
-
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
-
Open Services (Open Run Prompt, type Services.msc and press Enter)
-
Locate and select Accops HyWorks Controller Service and click on Restart link
-
Accops HyWorks Controller Service will get restarted and will now start sending the logs to configured SQL Server
-
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:
-
Connect to HyWorks Controller Server system using remote desktop connection or console session (if in HA, first connect to secondary HyWorks Controller server)
-
Go to HyWorks Controller Installation location (default installation path is mentioned below)
C:\Program Files (x86)\Accops\HyWorks\Service
-
Locate the configuration file log4net.config
-
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>
-
-
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>
-
Save the log4net.config file
-
Open Services (Open Run Prompt, type Services.msc and press Enter)
-
Locate and select Accops HyWorks Controller Service and click on Restart link
-
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 syslog 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.
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