SPARK-4147 [CORE] Reduce log4j dependency
SPARK-4147 [CORE] Reduce log4j dependency

Defer use of log4j class until it's known that log4j 1.2 is being used. This may avoid dealing with log4j dependencies for callers that reroute slf4j to another logging framework. The only change is to push one half of the check in the original `if` condition inside. This is a trivial change, may or may not actually solve a problem, but I think it's all that makes sense to do for SPARK-4147.

Author: Sean Owen <sowen@cloudera.com>

Closes #4190 from srowen/SPARK-4147 and squashes the following commits:

4e99942 [Sean Owen] Defer use of log4j class until it's known that log4j 1.2 is being used. This may avoid dealing with log4j dependencies for callers that reroute slf4j to another logging framework.

ahnqirage/spark,HyukjinKwon/spark,UndeadBaneGitHub/spark,ioana-delaney/spark,narahari92/spark,zuotingbing/spark,lvdongr/spark,1haodian/spark,cloud-fan/spark,stanzhai/spark,holdenk/spark,ddna1021/spark,apache-spark-on-k8s/spark,xflin/spark,kevinyu98/spark,dbtsai/spark,chuckchen/spark,michalsenkyr/spark,highfei2011/spark,icexelloss/spark,highfei2011/spark,ericvandenbergfb/spark,techaddict/spark,kiszk/spark,tengpeng/spark,ron8hu/spark,liutang123/spark,MLnick/spark,map222/spark,wangyum/spark,jianran/spark,darionyaphet/spark,gengliangwang/spark,skonto/spark,cin/spark,cloud-fan/spark,wangyum/spark,liyichao/spark,MLnick/spark,cloud-fan/spark,UndeadBaneGitHub/spark,lxsmnv/spark,esi-mineset/spark,goldmedal/spark,liutang123/spark,tejasapatil/spark,setjet/spark,actuaryzhang/spark,kiszk/spark,1haodian/spark,yanboliang/spark,haowu80s/spark,1haodian/spark,loneknightpy/spark,dongjoon-hyun/spark,bravo-zhang/spark,patrick-nicholson/spark,yanboliang/spark,apache-spark-on-k8s/spark,rednaxelafx/apache-spark,ConeyLiu/spark,Aegeaner/spark,patrick-nicholson/spark,maropu/spark,gioenn/xSpark,map222/spark,skonto/spark,xuanyuanking/spark,rezasafi/spark,mahak/spark,liyichao/spark,icexelloss/spark,WindCanDie/spark,goldmedal/spark,darionyaphet/spark,actuaryzhang/spark,JoshRosen/spark,actuaryzhang/spark,pgandhi999/spark,Panos-Bletsos/spark-cost-model-optimizer,apache/spark,jiangxb1987/spark,jrshust/spark,saltstar/spark,maropu/spark,cin/spark,caneGuy/spark,chuckchen/spark,mahak/spark,guoxiaolongzte/spark,wangyum/spark,zero323/spark,goldmedal/spark,esi-mineset/spark,byakuinss/spark,ioana-delaney/spark,esi-mineset/spark,Aegeaner/spark,akopich/spark,rezasafi/spark,ddna1021/spark,mzl9039/spark,bOOm-X/spark,apache-spark-on-k8s/spark,WeichenXu123/spark,JoshRosen/spark,debugger87/spark,dhruve/spark,huang1900/spark,highfei2011/spark,highfei2011/spark,spark-test/spark,minixalpha/spark,hvanhovell/spark,wzhfy/spark,map222/spark,lxsmnv/spark,witgo/spark,pgandhi999/spark,tejasapatil/spark,UndeadBaneGitHub/spark,kiszk/spark,publicRoman/spark,actuaryzhang/spark,akopich/spark,aosagie/spark,shubhamchopra/spark,mzl9039/spark,wangyum/spark,pgandhi999/spark,rednaxelafx/apache-spark,ajaysaini725/spark,WeichenXu123/spark,panfengfeng/spark,mahak/spark,holdenk/spark,jlopezmalla/spark,zero323/spark,eyalfa/spark,dhruve/spark,jkbradley/spark,milliman/spark,pronix/spark,milliman/spark,SHASHANKB/spark,highfei2011/spark,eyalfa/spark,aokolnychyi/spark,ueshin/apache-spark,caneGuy/spark,debugger87/spark,kevinyu98/spark,ddna1021/spark,brad-kaiser/spark,zero323/spark,minixalpha/spark,ptkool/spark,wangmiao1981/spark,patrick-nicholson/spark,maropu/spark,kimoonkim/spark,milliman/spark,jiangxb1987/spark,kimoonkim/spark,apache-spark-on-k8s/spark,metamx/spark,SnappyDataInc/spark,hhbyyh/spark,taroplus/spark,icexelloss/spark,pgandhi999/spark,vinodkc/spark,ConeyLiu/spark,hvanhovell/spark,ueshin/apache-spark,someorz/spark,panfengfeng/spark,gengliangwang/spark,bdrillard/spark,rezasafi/spark,kevinyu98/spark,hhbyyh/spark,ioana-delaney/spark,guoxiaolongzte/spark,mdespriee/spark,esi-mineset/spark,narahari92/spark,gengliangwang/spark,rikima/spark,shaneknapp/spark,adrian-ionescu/apache-spark,huang1900/spark,janewangfb/spark,andrewor14/spark,cin/spark,zero323/spark,bdrillard/spark,rekhajoshm/spark,setjet/spark,nilsgrabbert/spark,mzl9039/spark,michalsenkyr/spark,byakuinss/spark,techaddict/spark,saturday-shi/spark,andrewor14/spark,xuanyuanking/spark,darionyaphet/spark,sureshthalamati/spark,vinodkc/spark,chuckchen/spark,byakuinss/spark,ericvandenbergfb/spark,wzhfy/spark,shaneknapp/spark,jkbradley/spark,ajaysaini725/spark,nilsgrabbert/spark,SnappyDataInc/spark,darionyaphet/spark,yanboliang/spark,gengliangwang/spark,shaneknapp/spark,Panos-Bletsos/spark-cost-model-optimizer,zzcclp/spark,poffuomo/spark,markhamstra/spark,aosagie/spark,guoxiaolongzte/spark,tejasapatil/spark,LantaoJin/spark,shuangshuangwang/spark,WeichenXu123/spark,markhamstra/spark,narahari92/spark,bravo-zhang/spark,minixalpha/spark,dhruve/spark,saturday-shi/spark,SHASHANKB/spark,dongjoon-hyun/spark,byakuinss/spark,darionyaphet/spark,chuckchen/spark,facaiy/spark,jlopezmalla/spark,SnappyDataInc/spark,hhbyyh/spark,patrick-nicholson/spark,mdespriee/spark,srowen/spark,milliman/spark,witgo/spark,andrewor14/iolap,kimoonkim/spark,ericvandenbergfb/spark,minixalpha/spark,szhem/spark,joseph-torres/spark,hhbyyh/spark,mzl9039/spark,wangyum/spark,ioana-delaney/spark,Aegeaner/spark,tejasapatil/spark,narahari92/spark,jianran/spark,witgo/spark,taroplus/spark,maropu/spark,lxsmnv/spark,dhruve/spark,HyukjinKwon/spark,metamx/spark,andrewor14/spark,ConeyLiu/spark,mdespriee/spark,dbtsai/spark,taroplus/spark,spark-test/spark,ddna1021/spark,LantaoJin/spark,rikima/spark,andrewor14/iolap,aray/spark,nilsgrabbert/spark,lxsmnv/spark,Aegeaner/spark,debugger87/spark,andrewor14/spark,ron8hu/spark,kissmetrics/spark,icexelloss/spark,joseph-torres/spark,poffuomo/spark,huang1900/spark,WeichenXu123/spark,xuanyuanking/spark,akopich/spark,wangmiao1981/spark,esi-mineset/spark,yanboliang/spark,taroplus/spark,shuangshuangwang/spark,sachintyagi22/spark,milliman/spark,mdespriee/spark,apache-spark-on-k8s/spark,narahari92/spark,alunarbeach/spark,cloud-fan/spark,1haodian/spark,mahak/spark,andrewor14/spark,bOOm-X/spark,chuckchen/spark,zhouyejoe/spark,jrshust/spark,bdrillard/spark,dongjoon-hyun/spark,nchammas/spark,taroplus/spark,markhamstra/spark,minixalpha/spark,aosagie/spark,jkbradley/spark,brad-kaiser/spark,gioenn/xSpark,aokolnychyi/spark,eyalfa/spark,cin/spark,stanzhai/spark,shuangshuangwang/spark,gengliangwang/spark,nlalevee/spark,big-pegasus/spark,bravo-zhang/spark,bOOm-X/spark,ConeyLiu/spark,MLnick/spark,spark-test/spark,setjet/spark,facaiy/spark,nchammas/spark,wangmiao1981/spark,kevinyu98/spark,tengpeng/spark,rikima/spark,big-pegasus/spark,panfengfeng/spark,cloud-fan/spark,WeichenXu123/spark,hhbyyh/spark,liutang123/spark,lvdongr/spark,alunarbeach/spark,map222/spark,hvanhovell/spark,michalsenkyr/spark,esi-mineset/spark,metamx/spark,Panos-Bletsos/spark-cost-model-optimizer,skonto/spark,lvdongr/spark,goldmedal/spark,jiangxb1987/spark,byakuinss/spark,witgo/spark,srowen/spark,joseph-torres/spark,eyalfa/spark,sachintyagi22/spark,apache/spark,hvanhovell/spark,mdespriee/spark,nlalevee/spark,jrshust/spark,cloud-fan/spark,sahilTakiar/spark,BryanCutler/spark,andrewor14/iolap,byakuinss/spark,cin/spark,poffuomo/spark,ioana-delaney/spark,wangmiao1981/spark,huang1900/spark,bdrillard/spark,shubhamchopra/spark,kimoonkim/spark,SHASHANKB/spark,brad-kaiser/spark,SHASHANKB/spark,aosagie/spark,cin/spark,brad-kaiser/spark,aosagie/spark,ptkool/spark,shubhamchopra/spark,techaddict/spark,ddna1021/spark,JoshRosen/spark,caneGuy/spark,HyukjinKwon/spark,brad-kaiser/spark,kevinyu98/spark,patrick-nicholson/spark,hvanhovell/spark,aray/spark,bravo-zhang/spark,adrian-ionescu/apache-spark,zzcclp/spark,SHASHANKB/spark,aray/spark,rikima/spark,haowu80s/spark,mzl9039/spark,spark-test/spark,haowu80s/spark,ahnqirage/spark,aray/spark,jlopezmalla/spark,JoshRosen/spark,jrshust/spark,aray/spark,ConeyLiu/spark,shaneknapp/spark,HyukjinKwon/spark,mike0sv/spark,jrshust/spark,saltstar/spark,kiszk/spark,sureshthalamati/spark,poffuomo/spark,ptkool/spark,dhruve/spark,xflin/spark,aray/spark,zzcclp/spark,panfengfeng/spark,vinodkc/spark,andrewor14/iolap,aokolnychyi/spark,jrshust/spark,map222/spark,skonto/spark,sureshthalamati/spark,nilsgrabbert/spark,setjet/spark,jkbradley/spark,aosagie/spark,tejasapatil/spark,srowen/spark,mzl9039/spark,JoshRosen/spark,wangmiao1981/spark,goldmedal/spark,liutang123/spark,aosagie/spark,Panos-Bletsos/spark-cost-model-optimizer,saltstar/spark,nchammas/spark,tengpeng/spark,apache/spark,sahilTakiar/spark,goldmedal/spark,apache-spark-on-k8s/spark,liutang123/spark,pgandhi999/spark,rezasafi/spark,sachintyagi22/spark,debugger87/spark,ron8hu/spark,jiangxb1987/spark,wzhfy/spark,loneknightpy/spark,guoxiaolongzte/spark,kissmetrics/spark,michalsenkyr/spark,big-pegasus/spark,aokolnychyi/spark,debugger87/spark,xuanyuanking/spark,szhem/spark,apache-spark-on-k8s/spark,dbtsai/spark,akopich/spark,xflin/spark,nlalevee/spark,ahnqirage/spark,lxsmnv/spark,ahnqirage/spark,poffuomo/spark,zero323/spark,mzl9039/spark,ptkool/spark,joseph-torres/spark,jlopezmalla/spark,facaiy/spark,xflin/spark,Aegeaner/spark,holdenk/spark,holdenk/spark,szhem/spark,aokolnychyi/spark,tengpeng/spark,nlalevee/spark,maropu/spark,big-pegasus/spark,shuangshuangwang/spark,markhamstra/spark,joseph-torres/spark,saturday-shi/spark,gioenn/xSpark,saltstar/spark,rekhajoshm/spark,mike0sv/spark,rekhajoshm/spark,wzhfy/spark,kimoonkim/spark,techaddict/spark,bOOm-X/spark,liyichao/spark,sachintyagi22/spark,szhem/spark,JerryLead/spark,shubhamchopra/spark,ibm-research-ireland/sparkoscope,nilsgrabbert/spark,zuotingbing/spark,panfengfeng/spark,sahilTakiar/spark,publicRoman/spark,gioenn/xSpark,lxsmnv/spark,techaddict/spark,alunarbeach/spark,rednaxelafx/apache-spark,zuotingbing/spark,metamx/spark,rednaxelafx/apache-spark,jlopezmalla/spark,xuanyuanking/spark,WindCanDie/spark,holdenk/spark,actuaryzhang/spark,publicRoman/spark,map222/spark,bravo-zhang/spark,adrian-ionescu/apache-spark,darionyaphet/spark,ron8hu/spark,wzhfy/spark,michalsenkyr/spark,liyichao/spark,lvdongr/spark,rikima/spark,zhouyejoe/spark,apache/spark,janewangfb/spark,markhamstra/spark,mike0sv/spark,lxsmnv/spark,pronix/spark,stanzhai/spark,publicRoman/spark,minixalpha/spark,zuotingbing/spark,adrian-ionescu/apache-spark,joseph-torres/spark,LantaoJin/spark,ahnqirage/spark,apache/spark,BryanCutler/spark,ioana-delaney/spark,zero323/spark,zero323/spark,xuanyuanking/spark,WeichenXu123/spark,LantaoJin/spark,ueshin/apache-spark,bOOm-X/spark,szhem/spark,esi-mineset/spark,janewangfb/spark,ericvandenbergfb/spark,kimoonkim/spark,huang1900/spark,rikima/spark,kimoonkim/spark,tejasapatil/spark,SHASHANKB/spark,caneGuy/spark,ajaysaini725/spark,dbtsai/spark,poffuomo/spark,xflin/spark,mdespriee/spark,andrewor14/spark,kissmetrics/spark,highfei2011/spark,SnappyDataInc/spark,ueshin/apache-spark,shaneknapp/spark,haowu80s/spark,dhruve/spark,alunarbeach/spark,liyichao/spark,eyalfa/spark,actuaryzhang/spark,andrewor14/iolap,vinodkc/spark,lvdongr/spark,alunarbeach/spark,ptkool/spark,bdrillard/spark,holdenk/spark,kiszk/spark,shaneknapp/spark,jianran/spark,LantaoJin/spark,ajaysaini725/spark,xuanyuanking/spark,jkbradley/spark,rednaxelafx/apache-spark,JoshRosen/spark,sureshthalamati/spark,SHASHANKB/spark,srowen/spark,BryanCutler/spark,gioenn/xSpark,MLnick/spark,Panos-Bletsos/spark-cost-model-optimizer,SnappyDataInc/spark,andrewor14/iolap,loneknightpy/spark,gioenn/xSpark,yanboliang/spark,mdespriee/spark,srowen/spark,loneknightpy/spark,zhouyejoe/spark,mahak/spark,saturday-shi/spark,cin/spark,facaiy/spark,markhamstra/spark,Aegeaner/spark,jlopezmalla/spark,aokolnychyi/spark,panfengfeng/spark,WindCanDie/spark,ddna1021/spark,zzcclp/spark,map222/spark,nlalevee/spark,rezasafi/spark,saturday-shi/spark,tengpeng/spark,apache/spark,spark-test/spark,JerryLead/spark,rekhajoshm/spark,icexelloss/spark,JoshRosen/spark,dbtsai/spark,sachintyagi22/spark,kevinyu98/spark,ibm-research-ireland/sparkoscope,tengpeng/spark,skonto/spark,ron8hu/spark,vinodkc/spark,WindCanDie/spark,1haodian/spark,rednaxelafx/apache-spark,HyukjinKwon/spark,janewangfb/spark,zhouyejoe/spark,ibm-research-ireland/sparkoscope,SnappyDataInc/spark,ioana-delaney/spark,byakuinss/spark,pronix/spark,stanzhai/spark,bdrillard/spark,JerryLead/spark,loneknightpy/spark,haowu80s/spark,highfei2011/spark,janewangfb/spark,shubhamchopra/spark,BryanCutler/spark,taroplus/spark,xflin/spark,wangmiao1981/spark,caneGuy/spark,eyalfa/spark,janewangfb/spark,dongjoon-hyun/spark,Panos-Bletsos/spark-cost-model-optimizer,shaneknapp/spark,maropu/spark,MLnick/spark,akopich/spark,pgandhi999/spark,chuckchen/spark,icexelloss/spark,1haodian/spark,hvanhovell/spark,vinodkc/spark,yanboliang/spark,michalsenkyr/spark,nchammas/spark,milliman/spark,aokolnychyi/spark,pgandhi999/spark,jianran/spark,mahak/spark,caneGuy/spark,ericvandenbergfb/spark,spark-test/spark,jrshust/spark,nilsgrabbert/spark,mahak/spark,eyalfa/spark,guoxiaolongzte/spark,ueshin/apache-spark,taroplus/spark,kiszk/spark,witgo/spark,publicRoman/spark,kissmetrics/spark,srowen/spark,sureshthalamati/spark,BryanCutler/spark,zuotingbing/spark,adrian-ionescu/apache-spark,brad-kaiser/spark,ptkool/spark,MLnick/spark,ahnqirage/spark,UndeadBaneGitHub/spark,rekhajoshm/spark,ibm-research-ireland/sparkoscope,guoxiaolongzte/spark,pronix/spark,nchammas/spark,zzcclp/spark,sahilTakiar/spark,srowen/spark,metamx/spark,brad-kaiser/spark,someorz/spark,JerryLead/spark,sahilTakiar/spark,techaddict/spark,stanzhai/spark,mike0sv/spark,WindCanDie/spark,JerryLead/spark,maropu/spark,minixalpha/spark,zhouyejoe/spark,liyichao/spark,shubhamchopra/spark,andrewor14/iolap,gengliangwang/spark,adrian-ionescu/apache-spark,debugger87/spark,kevinyu98/spark,milliman/spark,skonto/spark,MLnick/spark,vinodkc/spark,holdenk/spark,patrick-nicholson/spark,jianran/spark,goldmedal/spark,facaiy/spark,sachintyagi22/spark,shuangshuangwang/spark,wangyum/spark,pronix/spark,mike0sv/spark,icexelloss/spark,ibm-research-ireland/sparkoscope,jkbradley/spark,zuotingbing/spark,shuangshuangwang/spark,jianran/spark,jiangxb1987/spark,WindCanDie/spark,shubhamchopra/spark,facaiy/spark,zzcclp/spark,saturday-shi/spark,Panos-Bletsos/spark-cost-model-optimizer,SnappyDataInc/spark,lvdongr/spark,jiangxb1987/spark,narahari92/spark,nchammas/spark,huang1900/spark,ron8hu/spark,alunarbeach/spark,adrian-ionescu/apache-spark,panfengfeng/spark,WindCanDie/spark,saltstar/spark,akopich/spark,ptkool/spark,mike0sv/spark,nlalevee/spark,kissmetrics/spark,zuotingbing/spark,HyukjinKwon/spark,big-pegasus/spark,wzhfy/spark,ericvandenbergfb/spark,shuangshuangwang/spark,chuckchen/spark,gioenn/xSpark,facaiy/spark,bdrillard/spark,yanboliang/spark,jianran/spark,setjet/spark,aray/spark,dbtsai/spark,pronix/spark,techaddict/spark,rekhajoshm/spark,haowu80s/spark,setjet/spark,hhbyyh/spark,wangyum/spark,ericvandenbergfb/spark,BryanCutler/spark,1haodian/spark,bravo-zhang/spark,xflin/spark,michalsenkyr/spark,ajaysaini725/spark,liyichao/spark,big-pegasus/spark,huang1900/spark,bOOm-X/spark,cloud-fan/spark,HyukjinKwon/spark,someorz/spark,WeichenXu123/spark,someorz/spark,guoxiaolongzte/spark,sahilTakiar/spark,janewangfb/spark,tengpeng/spark,loneknightpy/spark,rekhajoshm/spark,andrewor14/spark,ajaysaini725/spark,zhouyejoe/spark,markhamstra/spark,poffuomo/spark,big-pegasus/spark,hvanhovell/spark,nlalevee/spark,JerryLead/spark,saturday-shi/spark,joseph-torres/spark,kissmetrics/spark,apache/spark,saltstar/spark,szhem/spark,Aegeaner/spark,narahari92/spark,publicRoman/spark,kissmetrics/spark,ahnqirage/spark,kiszk/spark,someorz/spark,nilsgrabbert/spark,sahilTakiar/spark,ddna1021/spark,alunarbeach/spark,UndeadBaneGitHub/spark,matthewfranglen/spark,sureshthalamati/spark,BryanCutler/spark,saltstar/spark,witgo/spark,dbtsai/spark,ueshin/apache-spark,mike0sv/spark,ibm-research-ireland/sparkoscope,metamx/spark,someorz/spark,ron8hu/spark,someorz/spark,sureshthalamati/spark,witgo/spark,LantaoJin/spark,ajaysaini725/spark,metamx/spark,jkbradley/spark,rednaxelafx/apache-spark,spark-test/spark,LantaoJin/spark,gengliangwang/spark,skonto/spark,setjet/spark,rezasafi/spark,wangmiao1981/spark,bOOm-X/spark,caneGuy/spark,loneknightpy/spark,dongjoon-hyun/spark,bravo-zhang/spark,zzcclp/spark,ueshin/apache-spark,nchammas/spark,szhem/spark,hhbyyh/spark,sachintyagi22/spark,debugger87/spark,liutang123/spark,rezasafi/spark,JerryLead/spark,zhouyejoe/spark,UndeadBaneGitHub/spark,liutang123/spark,patrick-nicholson/spark,dongjoon-hyun/spark,jiangxb1987/spark,UndeadBaneGitHub/spark,ConeyLiu/spark,ibm-research-ireland/sparkoscope,jlopezmalla/spark,actuaryzhang/spark,lvdongr/spark,stanzhai/spark,wzhfy/spark,tejasapatil/spark,akopich/spark,publicRoman/spark,darionyaphet/spark,dhruve/spark,ConeyLiu/spark,stanzhai/spark,dongjoon-hyun/spark,rikima/spark