You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by jean leroux <jl...@hotmail.com> on 2008/01/05 14:43:56 UTC
log4net v1.2.10 System.ArgumentException: Destination array was not
long enough.
I am using log4net in my forms application and after a while I get an
unhandled exception in the memoryappender.
This is the log:
2008-01-05 12:02:30,828 [1888] DEBUG StockCapture.Window1 Unhandled
exception in application: System.ArgumentException: Destination array was
not long enough. Check destIndex and length, and the array's lower bounds.
at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array
destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
at System.Collections.ArrayList.ToArray(Type type)
at log4net.Appender.MemoryAppender.GetEvents() in
C:\MyDev\log4net\log4net-1.2.10\src\Appender\MemoryAppender.cs:line 78
at StockCapture.LogViewer.LogWatcher() in
C:\MyDev\StockCapture3\Logger\Logger.cs:line 116
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Any fixes for this?
Thanks
Jean
--
View this message in context: http://www.nabble.com/log4net-v1.2.10-System.ArgumentException%3A-Destination-array-was-not-long-enough.-tp14633240p14633240.html
Sent from the Log4net - Dev mailing list archive at Nabble.com.
Re: log4net v1.2.10 System.ArgumentException: Destination array was
not long enough.
Posted by dekin <de...@inbox.ru>.
This may occur due to synchronization issues because MemoryAppender isn't
thread-safe.
To fix this, provide your own thread-safe version for MemoryAppender by
synchronizing read/write operations, for example, with "lock" keyword.
jean leroux wrote:
>
> Unhandled exception in application: System.ArgumentException: Destination
> array was not long enough. Check destIndex and length, and the array's
> lower bounds.
>
--
View this message in context: http://old.nabble.com/log4net-v1.2.10-System.ArgumentException%3A-Destination-array-was-not-long-enough.-tp14633240p26517802.html
Sent from the Log4net - Dev mailing list archive at Nabble.com.