TvDatabase.TvBusinessLayer.SetLogLevel C# (CSharp) Method

SetLogLevel() public method

Set the log level
public SetLogLevel ( ) : void
return void
    public void SetLogLevel()
    {
      var logLevel = (LogLevel)int.Parse(GetSetting("loglevel", "5").Value); // default is debug
      Log.SetLogLevel(logLevel);
    }
  }

Usage Example

示例#1
0
    /// <summary>
    /// When implemented in a derived class, executes when a Start command is sent to the service by the Service Control Manager (SCM) or when the operating system starts (for a service that starts automatically). Specifies actions to take when the service starts.
    /// </summary>
    /// <param name="args">Data passed by the start command.</param>
    protected override void OnStart(string[] args)
    {
      if (_tvServiceThread == null)
      {
        if (!(args != null && args.Length > 0 && args[0] == "/DEBUG"))
        {
          RequestAdditionalTime(60000); // starting database can be slow so increase default timeout        
        }
        TvServiceThread tvServiceThread = new TvServiceThread();
        ThreadStart tvServiceThreadStart = new ThreadStart(tvServiceThread.OnStart);
        _tvServiceThread = new Thread(tvServiceThreadStart);

        _tvServiceThread.IsBackground = false;

        // apply process priority on initial service start.
        if (!_priorityApplied)
        {
          try
          {
            applyProcessPriority();
            _priorityApplied = true;
          }
          catch (Exception ex)
          {
            // applyProcessPriority can generate an exception when we cannot connect to the database
            Log.Error("OnStart: exception applying process priority: {0}", ex.StackTrace);
          }
        }

        var layer = new TvBusinessLayer();
        layer.SetLogLevel();

        _tvServiceThread.Start();

        while (!TvServiceThread.Started)
        {
          Thread.Sleep(20);
        }
      }
    }
All Usage Examples Of TvDatabase.TvBusinessLayer::SetLogLevel
TvBusinessLayer