Commit f7d5426
Changed files (2)
trunk
product
MoMoney.Service
Infrastructure
Logging
trunk/product/MoMoney.Service/Infrastructure/Logging/LogFileTasks2.cs
@@ -0,0 +1,32 @@
+using System.IO;
+using Gorilla.Commons.Infrastructure.Reflection;
+
+namespace MoMoney.Service.Infrastructure.Logging
+{
+ public interface ILogFileTasks
+ {
+ string get_the_contents_of_the_log_file();
+ string get_the_path_to_the_log_file();
+ }
+
+ public class LogFileTasks2 : ILogFileTasks
+ {
+ public string get_the_contents_of_the_log_file()
+ {
+ using (
+ var file_stream = new FileStream(get_the_path_to_the_log_file(), FileMode.Open, FileAccess.Read,
+ FileShare.ReadWrite))
+ {
+ using (var reader = new StreamReader(file_stream))
+ {
+ return reader.ReadToEnd();
+ }
+ }
+ }
+
+ public string get_the_path_to_the_log_file()
+ {
+ return Path.Combine(this.startup_directory(), @"logs\log.txt");
+ }
+ }
+}
\ No newline at end of file
trunk/product/MoMoney.Service/MoMoney.Service.csproj
@@ -81,7 +81,7 @@
<Compile Include="Application\NotificationMessage.cs" />
<Compile Include="Application\RegisterNewCompanyCommand.cs" />
<Compile Include="Application\SaveNewBillCommand.cs" />
- <Compile Include="Infrastructure\Logging\LogFileTasks.cs" />
+ <Compile Include="Infrastructure\Logging\LogFileTasks2.cs" />
<Compile Include="Infrastructure\ProjectTasks.cs" />
<Compile Include="Infrastructure\Updating\CancelUpdate.cs" />
<Compile Include="Infrastructure\Updating\CancelUpdateSpecs.cs" />