| | |
| | | using Castle.Core.Logging; |
| | | using LifePayment.Application.Sync; |
| | | using LifePayment.Domain.Shared; |
| | | using Microsoft.AspNetCore.Authorization; |
| | | using Microsoft.AspNetCore.Http; |
| | | using Microsoft.AspNetCore.Mvc; |
| | | using Microsoft.Extensions.Logging; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Threading.Tasks; |
| | | using Volo.Abp.AspNetCore.Mvc; |
| | | using ZeroD.Util; |
| | | |
| | | namespace LifePayment.HttpApi.LifePay |
| | | { |
| | |
| | | public class LogController : AbpController |
| | | { |
| | | private readonly ILogger<LogController> logger; |
| | | private readonly IHttpContextAccessor httpContextAccessor; |
| | | |
| | | public LogController(ILogger<LogController> logger) |
| | | public LogController( |
| | | ILogger<LogController> logger, |
| | | IHttpContextAccessor httpContextAccessor) |
| | | { |
| | | this.logger = logger; |
| | | this.httpContextAccessor = httpContextAccessor; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public void LogFront(string message) |
| | | public void LogFront(LogFrontInput message) |
| | | { |
| | | logger.LogInformation($"前端日志:{message}"); |
| | | string ip = httpContextAccessor.HttpContext?.Connection?.RemoteIpAddress?.ToString(); |
| | | logger.LogInformation($"前端日志(IP-{ip}):{message.ToJson()}"); |
| | | } |
| | | } |
| | | } |