CSFramework版本自动升级程序AutoUpgrader增加日志Log功能
CSFramework版本自动升级程序AutoUpgrader增加日志Log功能
扫一扫加微信
SELECT * FROM sys_Log
日志表:sys_Log
SQL Code:
CREATE TABLE [dbo].[sys_Log](
[isid] [int] IDENTITY(1,1) NOT NULL,
[LogType] [varchar](10) NULL,
[LogTime] [datetime] NULL,
[LogText] [nvarchar](250) NULL,
[PkgFileName] [varchar](250) NULL,
[IPLocal] [varchar](50) NULL,
[IPInterNet] [varchar](50) NULL,
[SystemName] [varchar](50) NULL,
CONSTRAINT [PK_sys_UpgradingHistory] PRIMARY KEY CLUSTERED
(
[isid] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
//来源:C/S框架网 | www.csframework.com | QQ:23404761
[isid] [int] IDENTITY(1,1) NOT NULL,
[LogType] [varchar](10) NULL,
[LogTime] [datetime] NULL,
[LogText] [nvarchar](250) NULL,
[PkgFileName] [varchar](250) NULL,
[IPLocal] [varchar](50) NULL,
[IPInterNet] [varchar](50) NULL,
[SystemName] [varchar](50) NULL,
CONSTRAINT [PK_sys_UpgradingHistory] PRIMARY KEY CLUSTERED
(
[isid] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
//来源:C/S框架网 | www.csframework.com | QQ:23404761
日志存储过程:
SQL Code:
ALTER PROCEDURE USP_AUTOUP_LOG
@Log NVARCHAR(500),
@PkgFileName VARCHAR(100),
@IPLocal VARCHAR(50),
@IPInternet VARCHAR(50)
AS
BEGIN
/*****************************************************************
添加CSFramework版本自动升级程序日志
SELECT * FROM sys_Log
SELECT * FROM dbo.sys_PackageTable
SELECT * FROM dbo.sys_UpgraderVersion
USP_AUTOUP_LOG 'test','','127.0.0.1','162.248,1,22'
USP_AUTOUP_LOG 'test','pack_20191211115018.pkg','127.0.0.1','162.248,1,22'
******************************************************************/
DECLARE @LogType VARCHAR(20)
DECLARE @SystemName VARCHAR(20)
IF ISNULL(@PkgFileName,'')<>''
BEGIN
SET @LogType='Download' --下载升级包
--版本号或升级包文件名
SELECT @SystemName=SystemName FROM sys_PackageTable
WHERE FileName=@PkgFileName OR VersionNo=@PkgFileName
END
ELSE
SET @LogType='Log' --日志
INSERT INTO dbo.sys_Log
( LogType ,
LogTime ,
LogText ,
PkgFileName ,
IPLocal ,
IPInterNet,
SystemName
)
SELECT @LogType,GETDATE(),@Log,@PkgFileName,@IPLocal,@IPInternet,@SystemName
END;
//来源:C/S框架网 | www.csframework.com | QQ:23404761
@Log NVARCHAR(500),
@PkgFileName VARCHAR(100),
@IPLocal VARCHAR(50),
@IPInternet VARCHAR(50)
AS
BEGIN
/*****************************************************************
添加CSFramework版本自动升级程序日志
SELECT * FROM sys_Log
SELECT * FROM dbo.sys_PackageTable
SELECT * FROM dbo.sys_UpgraderVersion
USP_AUTOUP_LOG 'test','','127.0.0.1','162.248,1,22'
USP_AUTOUP_LOG 'test','pack_20191211115018.pkg','127.0.0.1','162.248,1,22'
******************************************************************/
DECLARE @LogType VARCHAR(20)
DECLARE @SystemName VARCHAR(20)
IF ISNULL(@PkgFileName,'')<>''
BEGIN
SET @LogType='Download' --下载升级包
--版本号或升级包文件名
SELECT @SystemName=SystemName FROM sys_PackageTable
WHERE FileName=@PkgFileName OR VersionNo=@PkgFileName
END
ELSE
SET @LogType='Log' --日志
INSERT INTO dbo.sys_Log
( LogType ,
LogTime ,
LogText ,
PkgFileName ,
IPLocal ,
IPInterNet,
SystemName
)
SELECT @LogType,GETDATE(),@Log,@PkgFileName,@IPLocal,@IPInternet,@SystemName
END;
//来源:C/S框架网 | www.csframework.com | QQ:23404761
扫一扫加微信
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网