示例#1
0
            public void DoSyncUinInDBDate(object obj)
            {
                string cmd = AppConfig.SyncGatherDateIntSql;
                IAsyncDataService <TecentUinData> uin = new SyncDataService <TecentUinData>(AppConfig.UinDataConnString);
                int row = uin.ExecuteNoQuery(cmd);

                string.Format("Do Job Event, update row=【{0}】", row).WriteLog(new AssemblyExt().GetAppDir(AppStruct.WinApp));
            }
示例#2
0
            public void QuartQuery(object param)
            {
                //是否其他进程调度??

                IAsyncDataService <TecentUinData> async = new SyncDataService <TecentUinData>(AppConfig.UinDataConnString);
                // = new SyncDataService<TecentUinData>(AppConfig.DbConnString,AppConfig.CountUinCmd);
                int row = async.Count(AppConfig.CountUinCmd);

                string.Format("Do Job Event,Query row=【{0}】", row).WriteLog(new AssemblyExt().GetAppDir(AppStruct.WinApp));
            }
示例#3
0
        static void Main()
        {
            var syncDataService = new SyncDataService();
            var trackJsService  = new TrackJsService();

            var clientId    = ConfigurationManager.AppSettings["TrackJsClientId"];
            var apiKey      = ConfigurationManager.AppSettings["TrackJsApiKey"];
            var application = ConfigurationManager.AppSettings["TrackJsApplication"];

            if (string.IsNullOrEmpty(clientId))
            {
                Console.WriteLine("Track JS client ID is missing from the configuration");
                return;
            }

            if (string.IsNullOrEmpty(apiKey))
            {
                Console.WriteLine("Track JS API Key is missing from the configuration");
                return;
            }

            var endDate   = DateTime.Now;
            var startDate = syncDataService.GetLastDate();

            trackJsService.GetData(clientId, apiKey, application, startDate, endDate,
                                   data =>
            {
                var logEvent = new LogEventInfo(LogLevel.Warn, "", data.message);

                logEvent.Properties["messageDetails"] = data.message;
                logEvent.Properties["timestamp"]      = data.timestamp;
                logEvent.Properties["messageId"]      = data.id;
                logEvent.Properties["browserName"]    = data.browserName;
                logEvent.Properties["broswerVersion"] = data.browserVersion;
                logEvent.Properties["entry"]          = data.entry;
                logEvent.Properties["line"]           = data.line;
                logEvent.Properties["column"]         = data.column;
                logEvent.Properties["file"]           = data.file;
                logEvent.Properties["userId"]         = data.userId;
                logEvent.Properties["sessionId"]      = data.sessionId;
                logEvent.Properties["trackJsUrl"]     = data.trackJsUrl;
                logEvent.Properties["metadata"]       = data.metadata.ToOutput();

                LogService.Logger().Warn(logEvent);

                Console.WriteLine($"Add {data.message}");
            });

            syncDataService.UpdateLastDate(endDate);

            Console.WriteLine("Track JS LogStash complete");
        }