如何在Orchard.setup中使用Logger

时间:2019-03-25 01:56:09

标签: logging orchardcms

catch (Exception ex) {
    Logger.Error(ex, "Setup failed");
    _notifier.Error(T("Setup failed: {0}", ex.Message));
    model.Recipes = recipes;
    foreach (var recipe in recipes.Where(recipe => recipe.Name == model.Recipe)) {
        model.RecipeDescription = recipe.Description;
    }

    model.DatabaseIsPreconfigured = !String.IsNullOrEmpty(_setupService.Prime().DataProvider);
    return IndexViewResult(model); 
}

在setupcontroller的第163行,当发生错误时,Logger无法正常工作,如何使用logger?

0 个答案:

没有答案