aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenGridServices/OpenGrid.Framework.Data.MySQL/MySQLLogData.cs
blob: f1610ec9e7129418df20dd4dc54a3929b6e9e8ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Collections.Generic;
using System.Text;

namespace OpenGrid.Framework.Data.MySQL
{
    class MySQLLogData : ILogData
    {
        public MySQLManager database;

        public void Initialise()
        {
            IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini");
            string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname");
            string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database");
            string settingUsername = GridDataMySqlFile.ParseFileReadValue("username");
            string settingPassword = GridDataMySqlFile.ParseFileReadValue("password");
            string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling");
            string settingPort = GridDataMySqlFile.ParseFileReadValue("port");

            database = new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling, settingPort);
        }

        public void saveLog(string serverDaemon, string target, string methodCall, string arguments, int priority, string logMessage)
        {
            database.insertLogRow(serverDaemon, target, methodCall, arguments, priority, logMessage);
        }

        public string getName()
        {
            return "MySQL Logdata Interface";
        }

        public string getVersion()
        {
            return "0.1";
        }
    }
}