◷ Reading Time: 6 minutes
When Configurator has finished the configuration, it also creates your ExecAgent, Master Management, Master Execution and Workbench configuration file. FlexRule Server has a separate configuration file for each instance.
Config files
There are four types of configuration files:
- Agent Configuration File: FlexRule.Server.ExecAgent.dill.config
- Master Management Configuration File: FlexRule.Server.Master.Management.dll.config
- Master Execution: FlexRule.Server.Master.Execution.dll.config
- Master Workbench Configuration File: FlexRule.Server.Workbench.dill.config
Adding configuration section
FlexRule Server has a custom configuration section that is enabled by ServerConfigFile.
<configSections>
<section name="flexrule.server" type="FlexRule.Server.Configurations.ServerConfigFile, FlexRule.Server.Library" requirePermission="false" />
</configSections>
This then allows flexrule.server to be defined in the configuration files.
Agent config
<flexrule.server>
<settings>
<add key="ConsoleLiveOutput" value="false" />
<add key="AuthSigningKey" value="39xJ68-dX8KCa99tXs9PQq3@EZes2pLi" />
<add key="MasterAgentSharedSecret" value="eSQfB26@48fNuf6Wbs-79X8N8qTkQ7Sx" />
<add key="DbAddress" value="Data Source=.SQLEXPRESS;Initial Catalog="FRS 9.1.493";User ID=sa;Password=123;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False" />
</settings>
<agent>
<add key="GenericLogger" value="FlexRule.Server.Logging.LogFileWriter, FlexRule.Server.Library" />
<add key="ApiAddress" value="http://localhost:9002" />
</agent>
<backgroundTasks>
<add name="Job Runner" enabled="true" type="FlexRule.Server.Jobs.JobRunner, FlexRule.Server.Jobs" />
</backgroundTasks>
<monitoring enable="" includeDetails="true" prettifyDetails="true">
<channels></channels>
</monitoring>
</flexrule.server>
settings
- AuthSigningKey: This is the same key that the MasterManagement uses to sign the authentication token.
- MasterAgentSharedSecret: This is the same key that Master Managemeent and Agent share to identify each other.
agent
- ApiAddress: address that the agent will listen to in order to receive requests from its Master Execution.
Master Management config
<flexrule.server>
<settings>
<add key="ConsoleLiveOutput" value="false" />
<add key="MasterEncryptionPassword" value="7AGVdw3iJ2KSSjmv7327a2tv@-4C3RuQ" />
<add key="AuthSigningKey" value="39xJ68-dX8KCa99tXs9PQq3@EZes2pLi" />
<add key="MasterAgentSharedSecret" value="eSQfB26@48fNuf6Wbs-79X8N8qTkQ7Sx" />
<add key="DbAddress" value="Data Source=.SQLEXPRESS;Initial Catalog="FRS 9.1.520";User ID=sa;Password=123;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False" />
</settings>
<master>
<add key="GenericLogger" value="FlexRule.Server.Logging.LogFileWriter, FlexRule.Server.Library" />
<add key="ApiAddress" value="http://localhost:9005" />
</master>
<backgroundTasks>
<add name="Job Scheduler" enabled="true" type="FlexRule.Server.Jobs.JobScheduler, FlexRule.Server.Jobs" />
</backgroundTasks>
<monitoring enable="true" includeDetails="true" prettifyDetails="true">
<channels>
<add initializeData="C:Program Files (x86)FlexRuleServer<version>MasterManagementmaster.log" type="TextWriterTraceListener" name="fileLogListener" />
</channels>
<add event="ExceptionTraceEvent" channel="fileLogListener" level="Error" />
</monitoring>
</flexrule.server>
settings
- MasterEncryptionPassword: This password is used to encrypt User and Application account information (e.g., password) when they are stored in the database
- AuthSigningKey: This is the same key that the Agent uses to sign the authentication token.
- MasterAgentSharedSecret: This is the same key that the Master Management and ExecAgent share to identify each other.
master
- ApiAddress: address that the Master Management will listen to in order to receive requests from any client in its public API interface.
Master Workbench
To configure your Workbench you need to edit the Workbench configuration file. Workbench has a configuration file under:
[Local Disk]/Program Files (x86)/FlexRule/FlexRule Server/<version>/Master/Workbench/FlexRule/Config.jsx
Open the file by using any text editors (e.g., Notepad), then you will be able to change the the masterAddress. During the installation, the default Address is “localhost:.
managementAddress: 'http://localhost:9000' executionAddress: 'http://localhost:9001'
Monitoring section
Monitoring section allows you to stream events to a channel. It has two sections:
- Events: allows you to tell what events needs to be captured and be sent to a channel. This is where the tag
<add ... />is used. - Channels: allows to define a set of channels that can be instantiated and used to streaming events to them. This is where the tag
<channels>is used.
Below is an example:
<monitoring>
<add event="ExceptionTraceEvent" channel="eventLogListener" level="Error" enable="true" includeDetails="true" prettifyDetails="true"/>
<add event="ExceptionTraceEvent" channel="fileLogListener" level="Error" enable="true" includeDetails="true" prettifyDetails="true"/>
<channels>
<add initializeData="C:Program Files (x86)FlexRuleServer<version>MasterManagementmaster.log" type="TextWriterTraceListener" name="fileLogListener" />
<add initializeData="" type="EventLogTraceListener" name="eventLogListener" />
</channels>
</monitoring>
Channels
Channels are define with <add ... /> tag in the monitoring section.
<add initializeData="" type="" name="" />
And each channel must specify the below attributes:
- initializeData: will be used to provide some custom information to the channel.
- type: will be used to specify the type of channels (look at default channel)
- name: will be used to reference a channel at Events section
There are some default channels provided. Also custom channels can be created as well. For example to push events to Splunk, Database, etc.
Default channels
Out of the box, there are some default channels that are configurable using XML configuration. Below is the list of default channels:
- TextWriterTraceListener: allows writing on the file
- EventLogTraceListener: allows writing events on event log
- ConsoleTraceListener: allows writing events on console output
File-based Channel (TextWriterTraceListener)
When TextWriterTraceListener is used, you can specify name of the file as a constant value. For example master.log or you can parameterised name of the file by below values:
- {processid}: specify the process id of operating system that is writing in the file
- {machineid}: specify machine id of the server that process is running on
- {guid}: specify a new name every time
Example:
<add initializeData="master-{processid}.log" type="TextWriterTraceListener" name="fileLogListener" />