我有一个问题在NServiceBus中突然出现
Article::whereHas('category', function ($query) use ($categories) {
$query->where('slug', $categories);
})
->with('contents')
->orderBy('price', $default_sort)
->paginate(2);
如何设置权限以允许创建日志文件?
我从来没有遇到过这个问题,不知道为什么突然开始
我什至不想真正记录日志,因此我很乐意禁用它,我只是解决这个错误的任何解决方案,因为我需要继续处理其他问题
我尝试了以下逻辑来禁用日志记录,但是并没有任何作用
这被称为在我开始我的终点之前
System.UnauthorizedAccessException
HResult=0x80070005
Message=Access to the path 'd:\SfDevCluster\Data\_App\_Node_0\PATH\.diagnostics' is denied.
Source=mscorlib
StackTrace:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
at System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
at NServiceBus.HostStartupDiagnostics.BuildDefaultDiagnosticsWriter(ReadOnlySettings settings)
at NServiceBus.HostStartupDiagnostics.GetDiagnosticsWriter(ReadOnlySettings settings)
at NServiceBus.HostStartupDiagnostics.Setup(FeatureConfigurationContext context)
at NServiceBus.Features.FeatureActivator.ActivateFeature(FeatureInfo featureInfo, List`1 featuresToActivate, IConfigureComponents container, PipelineSettings pipelineSettings, RoutingComponent routing, ReceiveConfiguration receiveConfiguration)
at NServiceBus.Features.FeatureActivator.SetupFeatures(IConfigureComponents container, PipelineSettings pipelineSettings, RoutingComponent routing, ReceiveConfiguration receiveConfiguration)
at NServiceBus.InitializableEndpoint.<Initialize>d__1.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NServiceBus.Endpoint.<Start>d__1.MoveNext()
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
at Inspired.CommonConfiguration.<ApplyEndpointConfigurationAndStartEndpointAsync>d__3.MoveNext() in C:\Source\Inspired.TradingPlatform\src\Inspired.TradingPlatform.NServiceBus\Extensions\CommonConfiguration.cs:line 113
这是在本地1节点开发集群上发生的。看起来这是在网络服务帐户下运行的。该用户拥有完整权限
欢呼
保罗
答案 0 :(得分:0)
发生这种情况是因为您的应用程序无权在文件夹d:\SfDevCluster\Data\_App\_Node_0\PATH\.diagnostics
中写入
您应该将记录器配置为使用您的应用程序工作目录来存储这些日志,请查看另一个SO问题: NServiceBus endpoint is not starting on Azure Service Fabric local cluster
请记住,该文件夹是临时的,当您从节点中删除服务时可以随时删除该文件夹。