質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Mono

Monoは、Ecma標準に準じた.NET Framework互換の環境を実現するためのオープンソースのソフトウェア群です。Linux、Mac OS X、Windowsなど多くのプラットフォームで動作します。その他にも、特定プラットフォーム向けに特化したサブプロジェクトも存在します。

Q&A

1回答

2001閲覧

How do I use the log4net FileAppender under mono when running as a background process?

onitail

総合スコア12

Mono

Monoは、Ecma標準に準じた.NET Framework互換の環境を実現するためのオープンソースのソフトウェア群です。Linux、Mac OS X、Windowsなど多くのプラットフォームで動作します。その他にも、特定プラットフォーム向けに特化したサブプロジェクトも存在します。

0グッド

1クリップ

投稿2015/03/04 09:17

I'm having trouble using a log4net FileAppender with mono. If I spawn the processess in the background (i.e. mono MyApp.exe &), the process suspends after a short period of time. If I run the process in the foreground, the logger works correctly.

On the other hand, if I use a ConsoleAppender and redirect it (i.e. mono MyApp.exe > debug.log &), things are fine.

Here is my configuration for the application:

<appender name="debug-log" type="log4net.Appender.FileAppender"> <file value="debug.log" /> <appendToFile value="false" /> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%-8timestamp [%thread] %-5level %logger - %message%newline" /> </layout> </appender> <appender name="console" type="log4net.Appender.ConsoleAppender"> <layout type="log4net.Layout.PatternLayout"> <conversionPattern value="%-8timestamp [%thread] %-5level %logger - %message%newline" /> </layout> </appender> <root> <level value="DEBUG" /> <appender-ref ref="debug-log" /> </root> I am using the mono-specific version of the log4net assembly.

EDIT

Mono version: 2.10.1

I just noticed another interesting behavior... I am able to use the FileAppender to write to the debug-log as long as I redirect stdout anywhere. For example, if I start my process using the following:

mono MyApp.exe > /dev/null &
The process executes normally, writing to the debug-log. In this case, I am only using the debug-log, not the console appender. Using the same configuration, the process will suspend after writing a small amount of data to debug-log when I remove the redirect.

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

Probably, including me, the person whom there is here cannot understand English.
Therefore I think that there is not an answer even if I ask you a question here.

投稿2015/03/04 13:49

退会済みユーザー

退会済みユーザー

総合スコア0

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問