logging services calls in .txt file

I am trying to user the following code

private CModel[] getConfig(string CID, string Program)
        {
            ServiceManagement.ServiceClient obj;
            List<ServiceManagement.ManagementApiRepositoryCConfig> executedService;
            obj = new ServiceManagement.ServiceClient();
            executedService = new List<SaServiceIdentityManagement.ManagementApiRepositoryCConfig>();
            executedService = obj.getClubConfigSingle(CID, Program);

            return executedService.Select(x => new CModel
            {
                CID = CID,
                ProgramName = x.Name,
                ProgramURL = x.Value,
            }).ToArray();
        }  

and

using (StreamWriter w = File.AppendText("log.txt"))
        {
            Log("call 1", w);
            Log("call 2", w);
        }

What I am wanting to do is build a .txt, or xml, js/json file to log requests to the service

I am not sure why Im getting nothing added to the log.txt file

Thanks M


Source: .net

Leave a Reply