Introduction
Maidbot was created to give us the ability to get notifications on seq and other loggings. It has an api endpoint that can be used to queue a log. Once the log is consumed it queries our LoggingMatrix for the Application, Level, and Group. If a matrix is found the email is used to send a notification with the message of the log.
Seq Debugging
Since seq app can only be tested on seq, there is no way to debug locally. This adds a pain to testing the application. So if there is a need to test follow the following steps.
Local MaidBotApi Steps.
- Create your own test queue in QA Rabbit. Use the same exchange LCU.Logging.Direct and routing key for binding.
- Change appsettings to use your test queue.
Seq App Steps
- Make code adjustments to SeqToRabbit.
- Build
- Grab nuget package from bin.
- Change name of nuget to indicate it is for debugging.
- Go to QA server and to the seq nuget folder. (Currently C:\Program Files\Seq\Nuget)
- Add nuget file
- Go to QA seq --> settings --> Apps --> Install From Nuget
- Select "LocalMachine" as Feed.
- Add your test nuget package name and put as Package Id. (Doesn't require package version).
- Install.
- Add Instance
- Create a Title that indicates that it is Debuging/Testing.
- Add Stream that you wish to use to test. NOTE: Do not use information or other logging that occurs very frequently. If there is an issue with your app it will flood seq with errors.
- Add QA MaidBotApi url
- Select DebugMode to indicate that the raw log will be saved to our MaidBot DebugEventLog table.
- DO NOT select "Run the app on existing events" as this can cause a flood logs. (Unless fully aware what you are pulling in).
- Save Changes
#App Integration Steps
- Pull LCU.Api.Internal.MaidBotLib Nuget into project.
- Add Context of desired property such as Group.
- Log.ForContext(Enum.GetName(typeof(PropertyEnum), PropertyEnum.Group), Enum.GetName(typeof(GroupEnum), GroupEnum.ITDevelopment)) .Fatal("Failure return status, message: {0} {1}", e.Message, e.StackTrace);
- Use MaidBotApi swagger to create matrix to follow your app, desired level, and group.
- In Seq create signal that will capture this log(If not already created).
- Create instance that will watch this signal.