简体   繁体   中英

Is there no app tracing in mono?

Here is my project structure:

.
|-- app.config
|-- bin
|   `-- Debug
|-- NLog.config
|-- NLog.xsd
|-- obj
|   `-- Debug
|-- packages.config
|-- Program.cs
|-- Properties
|   `-- AssemblyInfo.cs
|-- ServiceClient.csproj
`-- Web References
    `-- TestSvc
        |-- Reference.cs
        |-- Reference.map
        |-- TestService.disco
        `-- TestService.wsdl

7 directories, 14 files

I've manually compiled the project using the below mcs command:

mcs -d:TRACE -d:DEBUG -r:System.Web.Services.dll -out:./bin/Debug/ServiceClient.exe Web\ References/TestSvc/Reference.cs Program.cs

I've even copied the app.config to the target folder as ServiceClient.exe.config

Heres what the configuration looks like:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.diagnostics>
    <sharedListeners>
        <add name="console" type="System.Diagnostics.ConsoleTraceListener"/>
        <add name="nlog" type="NLog.NLogTraceListener,Nlog"/>
    </sharedListeners>

    <sources>
        <source name="System.Net" switchValue="All">
            <listeners>
                <add name="nlog"/>
            </listeners>
        </source>
        <source name="System.Net.Sockets" switchValue="All">
            <listeners>
                <add name="nlog"/>
            </listeners>
        </source>
    </sources>
</system.diagnostics>
</configuration>

But when I run:

mono ServiceClient.exe "hello world"

I see no trace output...

Please try Mono log profiler .

Basically you need to run your application like this:

mono --profile=log ServiceClient.exe "hello world"

It will generate a file output.mlpd in the same directory. To see it:

mprof-report output.mlpd

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM