Skip to content
This repository has been archived by the owner on Apr 10, 2019. It is now read-only.

pngouin/CK-Glouton

Repository files navigation

CK-Glouton

Fifth semester's student project for INTECH IT school.

Build requirements

Build instructions

  1. Clone the repository
  2. In Powershell, run CodeCakeBuilder/Bootstrap.ps1
  3. Run CodeCakeBuilder/bin/Release/CodeCakeBuilder.exe

Usage

  1. Launch CK.Glouton.Sample.Server which is a basic implementation of CK.Glouton.Server.
  2. Configure your app to implement an Activicty Monitor with the CK.Glouton.Handler.Tcp.
  3. Now you can send some log to the sample server !

If you want to see your log and configure some alert

  1. Build the Angular app npm run build in <ProjectFolder>/src/CK.Glouton.Web/app.
  2. Create a appsetting.json from the already here appsetting.template.json (the lucene read location needs to be the same as the lucene write location).
  3. Launch CK.Glouton.Web
  4. Go to your site !

Configuration

The TCP Handler

System.Console.OutputEncoding = System.Text.Encoding.Unicode;

ActivityMonitor.AutoConfiguration += monitor => monitor.Output.RegisterClient( new ActivityMonitorConsoleClient() );

LogFile.RootLogPath = /* Path to your local logs save */

var grandOutputConfig = new GrandOutputConfiguration();

grandOutputConfig.AddHandler( new TextFileConfiguration
{
    MaxCountPerFile = 10000,
    Path = "Text",
} );

grandOutputConfig.AddHandler( new TcpHandlerConfiguration
{
    Host = "127.0.0.1",
    Port = 33698,
    IsSecure = false,
    AppName = typeof( Program ).GetTypeInfo().Assembly.GetName().Name,
    PresentEnvironmentVariables = true,
    PresentMonitoringAssemblyInformation = true,
    HandleSystemActivityMonitorErrors = true,
} );

GrandOutput.EnsureActiveDefault( grandOutputConfig );

See CK.Glouton.Sample.Client to see more.

The Glouton Server

var activityMonitor = new ActivityMonitor();

using( var server = new GloutonServer(
    "127.0.0.1",
    33698,
    activityMonitor,
    new SampleClientAuthorizationHandler()
) )
{
    server.Open( new HandlersManagerConfiguration
    {
        GloutonHandlers =
        {
            new BinaryGloutonHandlerConfiguration
            {
                Path = "Logs",
                MaxCountPerFile = 10000,
                UseGzipCompression = true
            },
            new LuceneGloutonHandlerConfiguration
            {
                MaxSearch = 1000
            },
            new AlertHandlerConfiguration
            {
                DatabasePath = "C:/Glouton/Alerts" // The folder where alerts will be saved, consider this as a mocked database.
            }
        }
    } );
}

See CK.Glouton.Sample.Server to see more.

The Web Application

"Lucene": {
    "MaxSearch": "1000",
    "Path": "C:/Glouton/Logs",
    "Directory": ""
  },
  "TcpControlChannel": {
    "Host": "localhost",
    "Port": 33698,
    "IsSecure": false
  },
  "Database": {
    "Path": "C:/Glouton/Alerts"
  },
  "Monitoring": {
    "LogPath": "Logs",
    "LogLevel": "Debug",
    "GrandOutput": {
      "Handlers": {
        "Console": true
      }
    }
Configuration Description
Lucene.MaxSearch The maximun number of logs returned by a single research with Lucene
Lucene.Path The folder where lucene files will be saved.
Lucene.Directory Custom subfolder for above.
TcpControlChannel.Host IpAddress of your CK.Glouton.Server.
TcpControlChannel.Port Port of your CK.Glouton.Server.
TcpControlChannel.IsSecure False by default we didn't implemented a secure connection yet !
Database.Path The folder where alerts will be saved, consider this as a mocked database.
Monitoring.LogPath Where log are written in local
Monitoring.Loglevel Minimum LogLevel
Monitoring.GrandOutput.Handler.Console Active Log in the console

NuGet packages

Feed Handler Server
MyGet CI MyGet Badge MyGet Badge
MyGet preview MyGet Badge MyGet Badge

Build status

Branch Visual Studio 2017
latest Build status
develop Build status

Contributing

Anyone and everyone is welcome to contribute. Please take a moment to review the guidelines for contributing.

License

Assets in this repository are licensed with the MIT License. For more information, please see LICENSE.md.

Open-source licenses

This repository and its components use the following open-source projects: