前提
ACCESSのVBAから呼び出されるDLLをVB.netで作成しております。
具体的にはDLLでDB更新処理を実装し、動作確認は取れております。
実現したいこと
上記機能のログをNlogライブラリを用いて出力したいです。
発生している問題・エラーメッセージ
VBAから呼び出す場合のみログが出力されません。
該当のソースコード
VB.net
1Public Class FacadeClass 2 Dim log = LogManager.GetCurrentClassLogger 3 4 Public Function UpdateDB() As Integer 5 log.Info("Log message") 6 'DB更新処理 7 Return '結果返却 8 End Function 9End Class
NLog.config
1<?xml version="1.0" encoding="utf-8" ?> 2<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" 3 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 4 autoReload="true" 5 throwExceptions="true" 6 throwConfigExceptions="true" 7 internalLogLevel="Off" internalLogFile="../logs/nlog_internal.log"> 8 9 <variable name="myvar" value="myvalue"/> 10 11 <targets> 12 <target 13 xsi:type="File" 14 name="file" 15 fileName="${basedir}/logs/${shortdate}.log" 16 layout="${longdate} ${uppercase:${level}} ${message}" /> 17 </targets> 18 <rules> 19 <logger name="*" minlevel="Trace" writeTo="file" /> 20 </rules> 21</nlog>
試したこと
対象のDLLをexeファイルから呼び出すとログは出力されます。
DLLファイルと同じフォルダに呼び出し元のACCESSを配置しても改善されないので権限周りの問題でもないように思います。
2022/11/02 15:48 追記
Nlogに限らず、そもそもファイル出力ができないようです。
回答1件
あなたの回答
tips
プレビュー