Re: Logging from a .dll

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




I see.

But my logging method (which just uses the Trace class) is in the .exe

So how would I write log entry from the .dll using a method in the .exe?

Peter Rilling wrote:
I mean the assembly the contains the log component. For example, whether it be log4net, or System.Diagnostics, or something else. I was just being generic and not assuming that you were using the framework classes for your logging.

"John Bailo" <jabailo@xxxxxxxxxx> wrote in message news:43E3CEF0.7040707@xxxxxxxxxxxxx

Peter Rilling wrote:

The same way you did it in the EXE, just make sure to be referencing the correct log assembly and namespace(s) in your DLL.

What do you mean by "log assembly" ?


"John Bailo" <jabailo@xxxxxxxxxx> wrote in message news:b8GdneHJBLiGJ37eRVn-sA@xxxxxxxxxxxxxxxx


I have a .exe that calls a .dll

I want to write log messages at various parts of the process in the .exe and .dll to a common trace/log file.

I set up a method in the .exe to write to the trace file, but to append basic information like DateTime.Now to each log entry.

How can I get my .dll to write to that same log file?




.



Relevant Pages

  • Re: Editors
    ... some strip them on exe files by default. ... "preferred base address" and, yup, relocations are completely ... DLL files, though, aren't loaded into their own address space but are ... EXE's "entry-point", though, is not "special" in that it's just an ...
    (alt.lang.asm)
  • Re: DLL pass vector by value crash
    ... The prototype for testfunc is a by-value copy, so it has to make a copy of the value. ... Are you using static linking for either the .exe (if so, it probably won't work correctly, ... clearly using the shared CRT DLL for the DLL you are constructing. ... no crash occurs in either config. ...
    (microsoft.public.vc.mfc)
  • Re: DLL pass vector by value crash
    ... stack of the exe and may allocate default member element on the exe heap. ... If this is a dangerous situation, the simple app I set up calling testFunc() ... in a dll did not crash. ... msvcr90.dll!free and access the source code of free.c. ...
    (microsoft.public.vc.mfc)
  • Re: Using same interfaces for in-proc vs. out-proc
    ... for each server) might work better after all. ... TLB,>you reference it in VB and gain access to all ... both EXE and DLL versions must use the same source code; ...
    (microsoft.public.vc.atl)
  • Re: Releasing my VB.NET app over the intranet
    ... of the primary EXE and when compiled I am copying the contents ... the directory and open a browser on the web server and type ... > another dll, we need to put the dll in the same directory, so that the clr ... > The executable will be downloaded to the assembly download cache on the ...
    (microsoft.public.dotnet.framework)