Advanced Log Configurations
The latest HyWorks Controller setup allows you to configure SQL Server as the log database. However, if you are using an older version of the HyWorks Controller that does not support SQL Server for the log database, please refer to the following subsection for guidance.
Using SQL Server for HyWorks Logs
Note:
-
This manual process requires restarting the HyWorks Controller Service and should be done under the supervision of the 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 for logging. Configuring the HyWorks Controller database and logging on the same instance may lead to performance degradation.
Configuration Steps to Change the Logs Server
Prerequisites:
- Another instance of SQL Server must be created for logging. To generate another database instance, rerun the SQL installer and follow the installation process.
Configuration Process:
-
Open Microsoft SQL Server Management Studio and Connect using the appropriate administrator credentials to the newly created SQL Server instance, which will 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 that the new database is created, execute 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 the HyWorks Controller Server system using a remote desktop connection or a console session (if in High Availability, first connect to the secondary HyWorks Controller server).
-
Navigate to the HyWorks Controller Installation location (the 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 to a safe location for backup.
-
Download the EncryptDecryptAppConfigFile tool (Please ask the Accops support team for the download link).
-
Copy the tool to the HyWorks Controller Server installation folder. The default installation path is:
C:\Program Files (x86)\Accops\HyWorks\Service
<<<<<<< HEAD 11. Run the tool with admin privileges. Browse the EDC.Service.exe file, and click Decrypt Config. The Default Location is: ======= 11. Run the tool with administrator privileges, browse to the EDC.Service.exe file, and click Decrypt Config. The Default Location is
22e45e93ca3d2b0cac15eac2f91e3d8d4cb270a8
> C:\\Program Files(x86)\\Accops\\HyWorks\\Service\\EDC.Service.exe
-
It will decrypt the EDC.Service.exe.config file for the next operation.
-
Open the EDC.Service.exe.config with WordPad.
-
In the ConnectionStrings section, locate the connection strings for LogsDBContext, which should be like the screenshot below.
-
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">
<<<<<<< HEAD 1. Please note that the highlighted sections should be changed as per the SQL Server instance configurations. The configurations are as follows: ======= 1. Please note that the highlighted sections should be modified according to the specific SQL Server instance configurations. The configurations are
22e45e93ca3d2b0cac15eac2f91e3d8d4cb270a8
1. SQL Server Address
2. SQL Server Instance Name
3. SQL Server Static Port to be used(Default port 1433; if port used different than 1433, then need to update in the connection string).
4. User ID: to be used to connect to SQL Server
5. Password: User password
-
Save the file.
-
Run the tool with administrator privileges, browse to the EDC.Service.exe file, and click 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, then click the Restart link.
-
Accops HyWorks Controller Service will restart and now send the logs to the configured SQL Server.
-
Perform a couple of activities on the HyWorks Controller Management Console, go to the Logs section, and verify if appropriate log entries are being created.
Note
<<<<<<< HEAD Old logs will not be moved to the new SQL Server but remain in the previous embedded logsdb. The location of the file is: C:\Program Files (x86)\Accops\HyWorks\Service\Logs ======= Old logs will not be moved to the new SQL Server but will remain in the previous embedded logsdb. The location of the file is:
- **C:\\Program Files (x86)\\Accops\\HyWorks\\Service\\Logs**
22e45e93ca3d2b0cac15eac2f91e3d8d4cb270a8
Alternate way of Configuring Syslog Server
Similar to the above section, where the HyWorks Controller server did not offer an option during installation to change the log database to SQL Server, but the same configurations can be achieved externally, Syslog server configurations were also not supported in the older version. To configure the Syslog server externally, the 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).
-
Navigate to the HyWorks Controller Installation location (the 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
<<<<<<< HEAD - In log4net.config find appender with the name \"RemoteSyslogAppender\" . - Set the Syslog Server`s IP address and port as per the highlighted section below. ======= - In log4net.config find appender with the name \"RemoteSyslogAppender\" (See screenshot below for reference)
-
Set the Syslog Server’s IP address and Port per the highlighted section below.
log4net.config
22e45e93ca3d2b0cac15eac2f91e3d8d4cb270a8
!!! note "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 the root section -> Add the 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, then click the Restart link.
-
Accops HyWorks Controller Service will restart and send the logs to the configured Syslog Server.
Note
- The configuration is tested with a CentOS-based Syslog server. If any issues are observed after configuration, please contact the Accops Support team.
- It requires a UDP-based syslog server, as the controller supports only UDP-based communication with a Syslog server.
Advance Configuration
Refer to section Advance Configuration for logs for the below settings:
-
Log Remover Control
-
Log Remover Threshold
-
UDP Log Listener Port
-
Log Remover Interval
-
Enable Tracing
-
Controller Session Monitoring